Improve debugging output from threads.