Added exit code 3 if environment autodetection fails