Fixed a bug when calculating CRC