Fixes for Firefox compatibility