fixed a bunch of bugs with the green caves emscripten interface