Fixed deprecations

Fixed deprecations in iOS 6+ and iOS 7+.