Fix a few accidental global assignments

Improve global environment hygiene