Fixed some mistakes in Env code