Fixes for running in the browser.