Improve the debug printing function: