Improved env-type flag