Resolved compatibility issues for Firefox and fixed a unit test.