Fix 2D rotation function