More fixes regarding environment