Fix cross-device move and patchset counting