Enhance tests and logging.