Fix the way in which environment variables are accessed.