Fix orientation bugs for iOS 8