Tweaked validation of ports
Added validation of env_vars