Fixing a number of problems which where breaking tests under Firefox.