Fixed another bug when autodetecting read length