fix folding of sequence to counts