Changes to the code that handles errors.  There was a free/unbound variable.  Looks like a copy paste bug.

Note I am not sure how this ever really worked.
Merge pull request #641 from violahs/master

Changes to the code that handles errors.