Fix for iOS 6, i.e. replace depreciated