Firefox fix where offsets are undefined