   long long key;
   int cnt, ival, icat, lastival;
   int ccnt, ctot, cnew, bestival, tmp;
-  float update, tmpx, clogc, impty, maximpty, lastimpty;
+  float update, tmpx, clogc, impty, minimpty, lastimpty;
 
   for (i = threadIdx.y + blockDim.y * blockIdx.x; i < ntrees*nnodes*nsamps; i += blockDim.y * gridDim.x) {
     // Process a group with fixed itree, inode, and ifeat


    lastival = -1;
    lastimpty = -1e7f;
    maximpty = -1e7f;
    ctot = 0;
    clogc = 0.0f;
    for (j = jc0; j < jc1; j += blockDim.x) {


#if __CUDA_ARCH__ >= 300

__global__ void __minImpurity(long long *keys, int *counts, int *out, float *outv, int *jc, int *fieldlens, 
                              int ntrees, int nnodes, int ncats, int nsamps) {
  __shared__ int catcnt[DBSIZE];
  __shared__ int fl[32];
