Fix tests to work in Firefox and Travis CI