Some fixes to Firefox compatibility.