Remove global variable leakage.
Merge pull request #181 from marcjansen/global

Remove global variable leakage. (no formal review)