Adding a debug mode to track down an elusive bug.