Fix variable 'r' global leak
Merge pull request #61 from abulrim/fix-global-r

Fix variable 'r' global leak