Fixed some errors resulting from function shuffling
Killed useless Env newtype