Fixed some debug output bugs