Fixed list clearing for compatibility with Python 2.7
Collect environmental variables in one place