Fix checksum calculation (it does look a bit ugly, though).