Fix cross-browser issues