Fixing exception handling and reporting