diff --git a/modules/cctbx_project/cctbx/maptbx/prepare_map_for_docking.py b/modules/cctbx_project/cctbx/maptbx/prepare_map_for_docking.py
index 5c0bbd68a1..03e18eceeb 100644
--- a/modules/cctbx_project/cctbx/maptbx/prepare_map_for_docking.py
+++ b/modules/cctbx_project/cctbx/maptbx/prepare_map_for_docking.py
@@ -1076,7 +1076,7 @@ def run_refine_cryoem_errors(
     target_power = default_target_spectrum(x) # Could have a different target
     target_spectrum.append(target_power)

-  assert (nref == sumw) # Check no Fourier terms lost outside bins
+  assert (sumw >= nref-1 and sumw < nref+1) # Check no Fourier terms lost outside bins
   slope = (sumw * sumwxy - (sumwx * sumwy)) / (sumw * sumwx2 - sumwx**2)
   intercept = (sumwy - slope * sumwx) / sumw
   wilson_scale_intensity = math.exp(intercept)
