Fix some bug in rotation