fix ports to ios and iossim that got broken over time. Now works with iOS7.