Fix variable leakage
Merge pull request #456 from arkx/master

Fix variable leakage