Added some more debug output to help iron out bugs.