Fixes #158: correctly deal with env vars containing spaces

I had some env vars with spaces in them and lead to duplicate keys