fixed some bugs in environment stuff, still doesn't work

Signed-off-by: Stuart Long <srl51@case.edu>