Don't use nonportable environment variables directly

Fixes #50