Fix a variable naming/scoping issue

Fixes #1