Make index restore work correctly