Cleaned up exception parsing and fixed a few bugs