Make copy of environment variable dict before converting, since the previous way was raising an exception.