diff --git a/src/calng/corrections/AgipdCorrection.py b/src/calng/corrections/AgipdCorrection.py
index c69436b9e3ad1ec108cdec40bfbe208d5b228f53..17b37ac04c427c0e1e88930d96d122cbd10d7302 100644
--- a/src/calng/corrections/AgipdCorrection.py
+++ b/src/calng/corrections/AgipdCorrection.py
@@ -470,9 +470,6 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
             else:
                 self.md_additional_offset.fill(0)
         elif constant is Constants.SlopesFF:
-            # Always has 352 cells, so allocating the right size in
-            # rel_gain_map fixes the shape problems here.
-
             # constant shape: y, x, memory cell
             if constant_data.shape[2] == 2:
                 # TODO: remove support for old format
@@ -486,9 +483,9 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
                         self._constant_memory_cells,
                     ),
                 )
-            self.xray_gain_map[:] = self._xp.asarray(
+            self.xray_gain_map[:] = self._pad_constant(self._xp.asarray(
                 constant_data.transpose(), dtype=np.float32
-            )[:self._constant_memory_cells]
+            ), value=1.0)[:self._constant_memory_cells]
         else:
             assert constant in bad_pixel_constants
             if (
@@ -507,7 +504,7 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
                 ):
                     # BadPixelsFF is not per gain stage - broadcasting along gain
                     constant_data = self._xp.broadcast_to(
-                        constant_data.transpose()[
+                        self._pad_constant(constant_data.transpose())[
                             :self._constant_memory_cells, ..., np.newaxis
                         ],
                         self._gm_map_shape,
@@ -518,7 +515,7 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
                 ):
                     # old BadPixelsPC have different axis order
                     constant_data = self._xp.broadcast_to(
-                        constant_data.transpose((0, 2, 1))[
+                        self._pad_constant(constant_data.transpose((0, 2, 1)))[
                             :self._constant_memory_cells, ..., np.newaxis
                         ],
                         self._gm_map_shape,