Improved exception handling when analysis fails