remove debug output, and a bug fix