fix bugs in ljs_env_clean