Updates for iOS 5 compatibility