Fix accidentally non-local variables
Merge pull request #518 from mg50/patch-1

Fix accidentally non-local variables