Fixes compatibility with iOS 5. Ref #2.