Fixed intersection and containment logic in SpatialGrid.