Improve edge-case logging.