More work on debug output cleanup and better message logging.