Some API fixes for running on iOS 6.

[FIXED]     Some iOS 6 fixes for iOS 7 API.