Fixing use of deprecated methods (iOS 6).