Fix bug caused by faulty debug
Improve debug format