Fixed emscripten build

Tested on chrome. It works well now