Move some optional debug output to where it actually applies.