Handle rotation correctly for iOS 6