Fix formatting bug and debug output