 +  unsigned int accumulated_sum=0;
 +  
 +  for (unsigned int vgc=0; vgc<vg; vgc++)
-+    accumulated_sum += this->n_vars(s,vg);
++    accumulated_sum += this->n_vars(s,vgc);
 +  
 +  libmesh_assert_less_equal (accumulated_sum, var);
 +  

           continue;
         }
     }
@@ -1202,27 +1203,24 @@
   if ( libMesh::processor_id() == (libMesh::n_processors()-1) )
     next_free_dof += _n_SCALAR_dofs;
 

         continue;
 
       MeshBase::element_iterator       elem_it  = mesh.active_local_elements_begin();
@@ -1115,7 +1116,7 @@
 
 	  // ... and only variables which are active on
 	  // on this element's subdomain
