Fix a problem in Exception logging.