Fix rotation computation