Fix bug when counting CSV records for indexing.