Fixed string-counting issue