fixed a few cross-browser issues