           n_bodies     -= nb;                                   //subtract from n_bodies number of bodies that have been extracted
           nl_pre       += nl;                                   //increase the number of leaves that where processed
           direct [tid] -= nb;                                   //subtract the number of extracted bodies in this pass
+#if 0
           prefix0[tid] = max(prefix0[tid] - nb, 0);             //same here, but do not let the number be negative (GT200 bug!?)
+#else
+          offset1 = max(offset1 - nb, 0);
+          prefix0[tid] = offset1;
+#endif
           n_direct     += nb;                                  //increase the number of bodies to be procssed
 
           while(n_direct >= DIM) 


#endif

  template<class OP, class T, const int BLOCKDIM2>
__device__ __inline__ T inclusive_scan_block(T v_in, const unsigned int idx) 
{
  __shared__ T shdata[WARP_SIZE];
  const unsigned int laneId = idx & (WARP_SIZE - 1);
  const unsigned int warpId = idx >> WARP_SIZE2;

  T val = inclusive_scan_warp<OP, T, WARP_SIZE2>(v_in, idx);
  if (31 == laneId) shdata[warpId] = val;
  __syncthreads();

  if (0 == warpId) shdata[idx] = inclusive_scan_warp<OP, T, BLOCKDIM2 - WARP_SIZE2>(shdata[idx], idx);
  __syncthreads();

  if (warpId > 0) val = OP::apply(shdata[warpId - 1], val);

  return val; 
}



#endif

        /******       APPROX          ******/
        /***********************************/

        offset2 = inclusive_scan_blockS<DIM2>(prefix_shmem, 1 - (split || !use_node), tid);
        offset  = offset2.x;
        n_total = offset2.y;
        if (!split && use_node) approx[n_approx + offset - 1] = node;
        __syncthreads();

        n_approx += n_total;

        while (n_approx >= DIM) 
