 
           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
+          directM[tid] -= nb;                                   //subtract the number of extracted bodies in this pass
           prefix0[tid] = max(prefix0[tid] - nb, 0);             //same here, but do not let the number be negative (GT200 bug!?)
           n_direct     += nb;                                  //increase the number of bodies to be procssed
 

  {
    if (tid < n_direct) 
    {
      const float4 posj = body_pos[direct[tid]];
#if 0
      const float4 posj  = tex1Dfetch(texBody, direct[tid]);
#endif
      sh_mass[tid] = posj.w;
      sh_pos [tid] = make_float3(posj.x, posj.y, posj.z);
      sh_jid [tid] = direct[tid];
    } else {
      sh_mass[tid] = 0.0f;
      sh_pos [tid] = make_float3(1.0e10f, 1.0e10f, 1.0e10f);
      sh_jid [tid] = -1;
    }

    __syncthreads();
#pragma unroll
    for (int j = 0; j < DIMx; j++) 
      if ((sh_jid[offs + j] >= 0)) 
        acc_i = add_acc(acc_i, pos_i, sh_mass[offs + j], sh_pos[offs + j], eps2);
#if 0
    direCount += DIMx;
#endif

        while (n_approx >= DIM) 
        {
          n_approx -= DIM;
          const int address      = (approxM[n_approx + tid] << 1) + approxM[n_approx + tid];
#ifndef TEXTURES
          const float4 monopole  = multipole_data[address    ];
#else
