diff --git a/modules/mol/base/src/query_state.cc b/modules/mol/base/src/query_state.cc
index c3e68560b175d21de8ad6591161e273a4b50f149..c84670d782b9d95699020d264aed8c240c5fb417 100644
--- a/modules/mol/base/src/query_state.cc
+++ b/modules/mol/base/src/query_state.cc
@@ -63,7 +63,7 @@ bool QueryState::do_within(const geom::Vec3& pos, const impl::WithinParam& p,
     if (op==COP_LE)
       return geom::Dot(d, d) <= p.GetRadiusSquare();
     else
-      return geom::Dot(d, d) >= p.GetRadiusSquare();    
+      return geom::Dot(d, d) > p.GetRadiusSquare();
   } else {
     const LazilyBoundRef& r=this->GetBoundObject(p.GetRef());
     for (AtomViewIter i=r.view.AtomsBegin(), e=r.view.AtomsEnd(); i!=e; ++i) {
@@ -72,7 +72,7 @@ bool QueryState::do_within(const geom::Vec3& pos, const impl::WithinParam& p,
         if (geom::Dot(d, d) <= p.GetRadiusSquare()) {
           return true;
         }
-      } else if (geom::Dot(d, d) <= p.GetRadiusSquare()) {
+      } else if (geom::Dot(d, d) > p.GetRadiusSquare()) {
         return false;
       }
     }