Improve CPM support for emscripten.