Minor fix to the indexing script