Fix environment handling.
better output in logs.