Fixed an issue with rotations being applied in the incorrect order.