Properly implement angle wrapping