Fix deprecation warnings under iOS 6