Fixes to work on Firefox