Fixed a couple issues when running in the browser.