Some minor fixes to environment