rm: prevent infinite loops for index parsing.