Fix glue errors
Reset error/exception handlers when an error occurs
Merge pull request #105 from FelixOnline/errors

Error handler fixes