Corrections to set/get environment scripts