Fix deletion of elements on sync.