Fix env handling in windows