Fix some bugs for firefox