Some fixes for firefox compatibility