Added correct environment variable parsing