General cleanup of debug logging.