anchor.diff:            call insert_t(t1, 1, +1, geo%ew1(p%icell%i1 + 1))
          end if
       else
  -       call insert_t(t1,1, +1, geo%ew1(p%icell%i1 + 1))
  -       call insert_t(t2,1, +1, geo%ew1(p%icell%i1 + 1))
  +       call insert_t(t1, 1, +1, geo%ew1(p%icell%i1 + 1))
  +       call insert_t(t2, 1, +1, geo%ew1(p%icell%i1 + 1))
       end if
   
       ! -------------------------------------------------
  
positive.code:     ! Spherical walls
      ! -------------------------------------------------
  
      pB=rv_xy + rv_z ; pB = pB + pB
      pC=r2_xy + r2_z
  
      ! Inner wall
      if(radial.and.p%on_wall.and.p%on_wall_id%w1==-1) then
         p%on_wall    = .false.
         p%on_wall_id%w1 = 0
      else if(.not.radial) then
         pC_1 = pC - geo%wr2(p%icell%i1)
         call quadratic_pascal_reduced(pB,pC_1,t1,t2)
         if(p%on_wall_id%w1 == -1) then
            if(abs(t1) < abs(t2)) then
               call insert_t(t2, 1, -1, geo%ew1(p%icell%i1))
  
negative.code:              call insert_t(t1, 1, -1, geo%ew1(p%icell%i1))
            end if
         else
            call insert_t(t1, 1, -1, geo%ew1(p%icell%i1))
            call insert_t(t2, 1, -1, geo%ew1(p%icell%i1))
         end if
  
      end if
  
      ! Check for intersections with outer wall.
      pC_2 = pC - geo%wr2(p%icell%i1 + 1)
      call quadratic_pascal_reduced(pB, pC_2, t1, t2)
  
      ! If we are on the outer wall, then we should discard the
      ! intersection with the smallest absolute value as this will be the
      ! wall we are on. Otherwise, we should include both values.
      if(p%on_wall_id%w1 == +1) then
         if(abs(t1) < abs(t2)) then
            call insert_t(t2, 1, +1, geo%ew1(p%icell%i1 + 1))
  