Fixes for cross-browser support