Fixes #158: correctly deal with env vars containing spaces