Fix for issue when using in plain old javascript from a browser.