Fixing C checksum code