Added header checksum calculation.