Fixed bug in sub-string indexer