Fixes for iOS 6 support