Fix problem in the rotation that was causing crashes