diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
index 902be1ccd9e61ad52b1ea988a00c333dc916502c..ec806125d14ad6c1eb0171c5d4d862491c9ab7ee 100644
--- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
+++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
@@ -247,7 +247,7 @@
     "if not corr_receiver:\n",
     "    # This part assumes this data_source structure: '{karabo_id}/DET/{receiver_name}:{output_channel}'\n",
     "    if gh2_detector == \"25um\":  # For 25um use virtual karabo_das for CALCAT data mapping.\n",
-    "        corr_receiver = data_sources[0].split(\"/\")[-1].split(\":\")[0][:-2]\n",
+    "        corr_receiver = data_sources[0].split(\"/\")[-1].split(\":\")[0]\n",
     "    else:\n",
     "        corr_receiver = data_sources[0].split(\"/\")[-1].split(\":\")[0]\n",
     "    print(f\"Using {corr_receiver} as a receiver name for the corrected data.\")"
@@ -443,10 +443,10 @@
     "\n",
     "    # Initialize GH2 data and gain arrays to store in corrected files.\n",
     "    if gh2_detector == \"25um\":\n",
-    "        dshape = dc[data_sources[0], \"data.adc\"].shape[:2]\n",
-    "        data_stored = np.zeros((dshape + (1280 * 2,)), dtype=np.float32)\n",
-    "        gain_stored = np.zeros((dshape + (1280 * 2,)), dtype=np.uint8)\n",
-    "        mask_stored = np.zeros((dshape + (1280 * 2,)), dtype=np.uint32)\n",
+    "        dshape_stored = (dc[data_sources[0], \"data.adc\"].shape[:2] + (1280 * 2,))\n",
+    "        data_stored = np.zeros(dshape_stored, dtype=np.float32)\n",
+    "        gain_stored = np.zeros(dshape_stored, dtype=np.uint8)\n",
+    "        mask_stored = np.zeros(dshape_stored, dtype=np.uint32)\n",
     "    else:\n",
     "        data_stored, gain_stored, mask_stored = None, None, None\n",
     "\n",
@@ -484,9 +484,7 @@
     "            gain_stored[..., i::2] = gain\n",
     "            mask_stored[..., i::2] = mask\n",
     "        else:  # \"50um\"\n",
-    "            data_stored = data_corr\n",
-    "            gain_stored = gain\n",
-    "            mask_stored = mask\n",
+    "            data_stored, gain_stored, mask_stored = data_corr, gain, mask\n",
     "\n",
     "    with DataFile(out_file, \"w\") as ofile:\n",
     "        # Create INDEX datasets.\n",
@@ -526,7 +524,7 @@
     "                    f\"data.{field}\", data=dc[src, f\"data.{field}\"].ndarray(),\n",
     "                    chunks=(chunks_data, data_corr.shape[1])\n",
     "            )\n",
-    "        outp_source.create_compressed_key(f\"data.mask\", data=mask)\n",
+    "        outp_source.create_compressed_key(f\"data.mask\", data=mask_stored)\n",
     "        step_timer.done_step(\"Storing data\")"
    ]
   },