Fixes for iOS 8 support