Fixed kmer search bug and refined some code