Simple checksum handling. Slight refactoring.