clean up debug output and other things