Add prefix check to index generation.