Changed SetEnv so it works on all machines

Please pool these changes