Resolve some environment variable issues