Make emscripten compatible