Renamed JsEnv to env; Fixed some functions