Fixed deprecated warnings for iOS 6