Does a better cleanup job.
Fixed path to emscripten, was using undefined variable.