Properly handling environment variables