Fix evaluation of environment variables.
Turn environment into dictionary.