Improve the debugging mode. Add more debugging info