Changed priority of env variables lookup