diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc
index 11faf18cb92f56a399f7f06fa67b484ec0073502..6b19f136c28966d7ebc842d8686f8539d893ff09 100644
--- a/AMDiS/src/DOFMatrix.cc
+++ b/AMDiS/src/DOFMatrix.cc
@@ -183,7 +183,9 @@ namespace AMDiS {
   {
     FUNCNAME("DOFMatrix::addElementMatrix()");
 
-    TEST_EXIT_DBG(inserter)("DOFMatrix is not in insertion mode");
+    TEST_EXIT_DBG(inserter)("DOFMatrix is not in insertion mode\n");
+    TEST_EXIT_DBG(rowFeSpace)("Have now rowFeSpace!\n");
+
     inserter_type &ins= *inserter;
  
     // === Get indices mapping from local to global matrix indices. ===
diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc
index 3b1496c611a5a02eb693dd1528995e307a8477f7..d85c82c6a49ce9bdb80fae252f5579b4cdcba420 100644
--- a/AMDiS/src/parallel/MeshDistributor.cc
+++ b/AMDiS/src/parallel/MeshDistributor.cc
@@ -62,6 +62,7 @@ namespace AMDiS {
 
   MeshDistributor::MeshDistributor()
     : probStat(0),
+      initialized(false),
       name("parallel"),
       feSpace(NULL),
       mesh(NULL),
@@ -163,6 +164,8 @@ namespace AMDiS {
 #if (DEBUG != 0)
     ParallelDebug::writeDebugFile(*this, debugOutputDir + "mpi-dbg", "dat");
 #endif    
+
+      initialized = true;
       return;
     }
 
@@ -320,6 +323,8 @@ namespace AMDiS {
     // === Remove periodic boundary conditions in sequential problem definition. ===
 
     removePeriodicBoundaryConditions();
+
+    initialized = true;
   }
 
 
@@ -412,6 +417,12 @@ namespace AMDiS {
     }
 
     probStat.push_back(probVec);
+
+    // If the mesh distributor is already initialized, don't forgett to set rank
+    // DOFs object to the matrices and vectors of the added stationary problem.
+
+    if (initialized)
+      setRankDofs(probVec);
   }
 
 
@@ -623,22 +634,27 @@ namespace AMDiS {
   }
 
 
-  void MeshDistributor::setRankDofs()
+  void MeshDistributor::setRankDofs(ProblemVec *probVec)
   {
-    for (unsigned int i = 0; i < probStat.size(); i++) {
-      int nComponents = probStat[i]->getNumComponents();
-      for (int j = 0; j < nComponents; j++) {
-	for (int k = 0; k < nComponents; k++)
-	  if (probStat[i]->getSystemMatrix(j, k))
-	    probStat[i]->getSystemMatrix(j, k)->setRankDofs(isRankDof);
+    int nComponents = probVec->getNumComponents();
+    for (int i = 0; i < nComponents; i++) {
+      for (int j = 0; j < nComponents; j++)
+	if (probVec->getSystemMatrix(i, j))
+	  probVec->getSystemMatrix(i, j)->setRankDofs(isRankDof);
+
+      TEST_EXIT_DBG(probVec->getRhs()->getDOFVector(i))("No RHS vector!\n");
+      TEST_EXIT_DBG(probVec->getSolution()->getDOFVector(i))("No solution vector!\n");
+      
+      probVec->getRhs()->getDOFVector(i)->setRankDofs(isRankDof);
+      probVec->getSolution()->getDOFVector(i)->setRankDofs(isRankDof);
+    }    
+  }
 
-	TEST_EXIT_DBG(probStat[i]->getRhs()->getDOFVector(j))("No RHS vector!\n");
-	TEST_EXIT_DBG(probStat[i]->getSolution()->getDOFVector(j))("No solution vector!\n");
-	
-	probStat[i]->getRhs()->getDOFVector(j)->setRankDofs(isRankDof);
-	probStat[i]->getSolution()->getDOFVector(j)->setRankDofs(isRankDof);
-      }
-    }
+
+  void MeshDistributor::setRankDofs()
+  {
+    for (unsigned int i = 0; i < probStat.size(); i++) 
+      setRankDofs(probStat[i]);
   }
 
 
diff --git a/AMDiS/src/parallel/MeshDistributor.h b/AMDiS/src/parallel/MeshDistributor.h
index d21771ad6f393b549287b0913dc7dd992d4caca4..07b16877cadb5969dc511179d1fa47cba365e7b7 100644
--- a/AMDiS/src/parallel/MeshDistributor.h
+++ b/AMDiS/src/parallel/MeshDistributor.h
@@ -346,6 +346,10 @@ namespace AMDiS {
      */
     void repartitionMesh();
 
+    /// Sets \ref isRankDof to all matrices and rhs vectors in a given 
+    /// stationary problem.
+    void setRankDofs(ProblemVec *probVec);
+
     /// Sets \ref isRankDof to all matrices and rhs vectors in all stationary problems.
     void setRankDofs();
 
@@ -419,9 +423,12 @@ namespace AMDiS {
     }
 
   protected:
-    ///
+    /// List of all stationary problems that are managed by this mesh distributor.
     vector<ProblemVec*> probStat;
 
+    /// If true, the mesh distributor is already initialized;
+    bool initialized;
+
     /// The rank of the current process.
     int mpiRank;