Fix for iOS6 compatability.

A lot simpler than first thought!