Changes for building + compatibility with new Firefox.