setup-env.sh:fixes and improvements