Fixing exception tracking on error