Fixed crashes in iOS 5.