diff --git a/bilby/core/grid.py b/bilby/core/grid.py
index 8562e6d67b3afbaa863e85fe8125e62248a7bc41..8e264872d84fa2ef1daa9fc9a8b0d51c9de398a0 100644
--- a/bilby/core/grid.py
+++ b/bilby/core/grid.py
@@ -191,8 +191,10 @@ class Grid(object):
         places = self.sample_points[name]
 
         if len(places) > 1:
+            dx = np.diff(places)
             out = np.apply_along_axis(
-                logtrapzexp, axis, log_array, places[1] - places[0])
+                logtrapzexp, axis, log_array, dx
+            )
         else:
             # no marginalisation required, just remove the singleton dimension
             z = log_array.shape