Add handling of checksum error, increase test coverage