iOS 8 compatibility fixes