A bunch of tiny changes. Fix CRC error with > 65535 byte inputs.