Fix error merging items with relations in unsynced library