Added the 20px-bug fix for ios7 (and fixed a bug in detection)