Fix for iOS6 compatability.

A lot simpler than first thought! Fixes #82