Use env

Fix ENV-> env and merge latest upstream