Add test for reference error in #49
Fix reference error in #49

[closes #49]
Merge pull request #50 from ForbesLindesay/fix-49

Fix reference error in #49