Fix crash in rotation