Clean up code and fix CRC problems.