  	    libmesh_assert_not_equal_to (first_dof, DofObject::invalid_id);
  	  }
        }
-@@ -1083,25 +1086,19 @@
+@@ -1083,25 +1090,19 @@
  void DofMap::distribute_local_dofs_var_major(unsigned int &next_free_dof,
                                               MeshBase& mesh)
  {

           continue;
         }
     }
@@ -1064,13 +1067,13 @@
       {
 	Node *obj = *node_it;
 	libmesh_assert(obj);

+	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 @@
 }
 
 
