Fix byte counting for > 2^32 bytes.

There was a bug with byte counting that affected
input of > 2^32 bytes in length.