Fix bugs in firefox