Fix checksum calculation