Just doing some cleanup, and add debug code.