    //-------------------------------------------------------------------------
    // First count and assign temporary numbers to local dofs
    MeshBase::element_iterator       elem_it  = mesh.active_local_elements_begin();
-@@ -964,45 +954,51 @@
+@@ -964,45 +954,52 @@
        for (unsigned int n=0; n<n_nodes; n++)
          {
            Node* node = elem->get_node(n);

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

     } // done looping over elements
 
 
@@ -1023,27 +1020,34 @@
 	Node *node = *node_it;
 	libmesh_assert(node);
 
