Fix crashes in iOS 6.x