Bug fix for rotate