Improved set_env.sh