Slight modification of debug output. adding comment where suspected issue lies (caculating number of byte is wrong when the line have trailing space after data.