Fix a bug where index wasn't being updated on DeleteById