Fix checksum calculation

Don't write the checksum word into the last chunk as well as the first one; mimics ce17cc2e2b8b5afe79247dcd96f1fc222fed1dfc