implement CRC 8 and minor fix