Fixed some bugs in firefox