Rotation angle between 0 and 360.

Also add a test for this. Fix for issue introduced in #3036