Fix crash when items are moved in model.