diff --git a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb
index 7d5c758ffe776d861d8b3bba690c6068b65c0b90..c51bddf95188fd68e422ec1532f1a386481d2939 100644
--- a/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb
+++ b/notebooks/AGIPD/AGIPD_Correct_and_Verify.ipynb
@@ -297,9 +297,18 @@
     "    # This hardcodes the receiver_id and path_template parameters currently, but this\n",
     "    # will disappear with moving the entire notebook to EXtra-data.\n",
     "    subdc = dc.select_trains(by_id[train_ids]).select(f'{karabo_id}/DET/*CH0:xtdf')\n",
-    "    sequences = sorted({int(f.filename[-8:-3]) for f in subdc.files})\n",
+    "    subseq = {int(f.filename[-8:-3]) for f in subdc.files}\n",
+    "    \n",
+    "    if sequences == [-1]:\n",
+    "        # All sequences were meant to be processed by this job, so take the entire\n",
+    "        # subset of sequences.\n",
+    "        sequences = sorted(subseq)\n",
+    "    else:\n",
+    "        # If explicit sequences were specified (e.g. due to job balancing by xfel-calibrate)\n",
+    "        # only work on the intersection between that and what the PPU device offers.\n",
+    "        sequences = sorted(set(sequences) & subseq)\n",
     "\n",
-    "elif train_ids[0] != [-1]:\n",
+    "elif train_ids != [-1]:\n",
     "    # Specific trains passed by parameter, convert to ndarray.\n",
     "    train_ids = np.array(train_ids)\n",
     "    \n",