Small bug in rotation matrix generation