More environment fixes