fix obvious bugs in latest versions of firefox and safari on mac