Move the debug print code into $OUTPUT.