Minor bugfixes. Still need to work out crc.