Fix broken sync `id` logic