Fix environment bugs

Signed-off-by: compmonks <compmonks@compmonks.com>