Update CRC check and bad header check.
Refactor CRC sanity checks.