Fixed #1.
Merge pull request #2 from aaditmshah/fix_reference_error_bug

Fixed #1.