Fix exception output and reporting of exceptions