Fix set env handling.