Fix errors in Safari
Fix tests for Firefox