Also handle more types of exceptions. *** First commit compatible with the C rewrite!! ***
I should've made a git repo for this much sooner, oops :p