miscellaneous fixes (merged from later Firefox issues) to make it compile with gcc-4.7 - fixes issue #7