Cleanup exception handling.