Logic flaw in `environmentify` method