Don't rely on ENV. Fixes #532

Fixes #532 . From the history it just seems that nobody ever updated it.