Don't rely on ENV. Fixes #532
Merge pull request #535 from oscardelben/fix_env_typo

Don't rely on ENV. Fixes #532