Fixed bug where for-loop variable name was reused.
Merge pull request #20 from gheld/master

Fixed bug where for-loop variable name was reused.