You can solve the negative bearing problem by adding 360°.
Unfortunately, this might result in bearings larger than 360° for positive bearings.
This is a good candidate for the modulo operator, so all in all you should add the line
Bearing = (Bearing + 360) % 360
at the end of your method.