I think I found the problem. There are twice as many color values as characters in the document. The color values Are added to the pixels once three color values are gathered. If the document isnt 0 mod 3 characters long, 1 or 2 characters are lost.