Fix use of environment variables