Add a little debug code for tracking down a couple issues.
I really need to make all of this work better. Next commits may rework a lot of the backend.