Fix build for iOS6

This is PR #15, with a fix to compile on iOS 6 and earlier. Hopefully this will pass the Travis CI tests.