checksum calculation: Add some fixes by mypikachu

Signed-off-by: Oliver Metz <oliver@freetz.org>