Fixes for Emscripten build
Merge pull request #398 from eddyc/develop

Fixes for Emscripten build