Various cross-browser fixes