Fix exception messages and logging.