  	    continue;
  
            const unsigned int n_nodes = elem->n_nodes();
-@@ -1127,31 +1124,32 @@
+@@ -1127,31 +1128,32 @@
  
                // assign dof numbers (all at once) if this is
                // our node and if they aren't already there

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

+	ncg = this->n_comp_group(s,vg),
+	vig = this->system_var_to_vg_var(s,vg,var);
+
+      // std::cout << "base_idx, var, vg, vig, ncg, comp="
+      // 		<< base_idx << " "
+      // 		<< var << " "
+      // 		<< vg << " "
+      // 		<< vig << " "
+      // 		<< ncg << " "
+      // 		<< comp << '\n';
+
+      return (base_idx + vig*ncg + comp);
+    }
 }
 
 
@@ -639,6 +786,87 @@
 }
 
 
