Fix iOS7 to work in WP and Firefox. Closes #172 and #224.
(cherry picked from commit 24c16f0)