fixed emscripten errors; still bit-mess in JS-result