compilation fixes for emscripten