Fix bugs on Firefox
Fix tests for Firefox