Don't rely on ENV. Fixes #534

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