More fixes to env passing.