Remove extraneous newlines from debug output caused by using puts