Fixes for calculating checksum.