Fixes for running in browser