Fixes environment_get_variable

I don't know who programmed the old version, but it was severely damaged.