diff --git a/AMDiS/src/DirichletBC.cc b/AMDiS/src/DirichletBC.cc
index dd50570ee479bd161cee2cfdd005a5b8470acc2b..0cbd6ff4348c01df452a4319e222efc96c98589d 100644
--- a/AMDiS/src/DirichletBC.cc
+++ b/AMDiS/src/DirichletBC.cc
@@ -6,18 +6,31 @@
 
 namespace AMDiS {
 
-  DirichletBC::DirichletBC(BoundaryType       type,
+  DirichletBC::DirichletBC(BoundaryType type,
+			   AbstractFunction<double, WorldVector<double> > *fct,
+			   FiniteElemSpace *rowFESpace,
+			   FiniteElemSpace *colFESpace)
+    : BoundaryCondition(type, rowFESpace, colFESpace), 
+      f(fct), 
+      dofVec(NULL)
+  {
+    worldCoords.resize(omp_get_max_threads());
+  };
+
+  DirichletBC::DirichletBC(BoundaryType type,
 			   DOFVectorBase<double> *vec)
     : BoundaryCondition(type, vec->getFESpace()), 
       f(NULL), 
       dofVec(vec)
-  {}
+  {
+    worldCoords.resize(omp_get_max_threads());
+  }
 
-  void DirichletBC::fillBoundaryCondition(DOFMatrix*             matrix,
-					  ElInfo*                elInfo,
+  void DirichletBC::fillBoundaryCondition(DOFMatrix* matrix,
+					  ElInfo* elInfo,
 					  const DegreeOfFreedom* dofIndices,
-					  const BoundaryType*    localBound,
-					  int                    nBasFcts)
+					  const BoundaryType* localBound,
+					  int nBasFcts)
   {
     FUNCNAME("DirichletBC::fillBoundaryCondition()");
 
@@ -25,11 +38,11 @@ namespace AMDiS {
       ("invalid row fe space\n");
   }
 
-  void DirichletBC::fillBoundaryCondition(DOFVectorBase<double>*     vector,
-					  ElInfo*                elInfo,
+  void DirichletBC::fillBoundaryCondition(DOFVectorBase<double>* vector,
+					  ElInfo* elInfo,
 					  const DegreeOfFreedom* dofIndices,
-					  const BoundaryType*    localBound,
-					  int                    nBasFcts)
+					  const BoundaryType* localBound,
+					  int nBasFcts)
   {
     FUNCNAME("DirichletBC::fillBoundaryCondition()");
 
@@ -37,12 +50,14 @@ namespace AMDiS {
       ("invalid row fe space\n");
 
     const BasisFunction *basFcts = rowFESpace->getBasisFcts();
+    int myRank = omp_get_thread_num();
+
     for (int i = 0; i < nBasFcts; i++) {
       if (localBound[i] == boundaryType) {
 	if (f) {
 	  DimVec<double> *coords = basFcts->getCoords(i);
-	  const WorldVector<double> *worldCoords = elInfo->coordToWorld(*coords, NULL);
-	  double fAtCoords = (*f)(*worldCoords);
+	  elInfo->coordToWorld(*coords, &(worldCoords[myRank]));
+	  double fAtCoords = (*f)(worldCoords[myRank]);
 	  (*vector)[dofIndices[i]] = fAtCoords;
 	}
 	if (dofVec) {
diff --git a/AMDiS/src/DirichletBC.h b/AMDiS/src/DirichletBC.h
index 4079124e51eef8b059a1e30afb0080d113e47a49..5dfee096ae102a4eabf41508cc6968313037e3bc 100644
--- a/AMDiS/src/DirichletBC.h
+++ b/AMDiS/src/DirichletBC.h
@@ -24,6 +24,7 @@
 
 #include "BoundaryCondition.h"
 #include "AbstractFunction.h"
+#include "OpenMP.h"
 
 namespace AMDiS {
 
@@ -49,38 +50,34 @@ namespace AMDiS {
     /** \brief
      * Constructor.
      */
-    DirichletBC(BoundaryType                                    type,
+    DirichletBC(BoundaryType type,
 		AbstractFunction<double, WorldVector<double> > *fct,
-		FiniteElemSpace                                *rowFESpace,
-		FiniteElemSpace                                *colFESpace = NULL)
-      : BoundaryCondition(type, rowFESpace, colFESpace), 
-        f(fct), 
-        dofVec(NULL)
-    {};
+		FiniteElemSpace *rowFESpace,
+		FiniteElemSpace *colFESpace = NULL);
 
     /** \brief
      * Constructor.
      */
-    DirichletBC(BoundaryType          type,
+    DirichletBC(BoundaryType type,
 		DOFVectorBase<double> *vec);
 
     /** \brief
      * Implementation of BoundaryCondition::fillBoundaryCondition().
      */
-    void fillBoundaryCondition(DOFMatrix*     matrix,
-			       ElInfo*                elInfo,
+    void fillBoundaryCondition(DOFMatrix* matrix,
+			       ElInfo* elInfo,
 			       const DegreeOfFreedom* dofIndices,
-			       const BoundaryType*    localBound,
-			       int                    nBasFcts);
+			       const BoundaryType* localBound,
+			       int nBasFcts);
   
     /** \brief
      * Implementation of BoundaryCondition::fillBoundaryCondition().
      */
-    void fillBoundaryCondition(DOFVectorBase<double>*     vector, 
-			       ElInfo*                elInfo,
+    void fillBoundaryCondition(DOFVectorBase<double>* vector, 
+			       ElInfo* elInfo,
 			       const DegreeOfFreedom* dofIndices,
-			       const BoundaryType*    localBound,
-			       int                    nBasFcts);
+			       const BoundaryType* localBound,
+			       int nBasFcts);
 
     /** \brief
      * Implementation of BoundaryCondition::boundResidual().
@@ -109,6 +106,8 @@ namespace AMDiS {
      */
     AbstractFunction<double, WorldVector<double> > *f;
 
+    std::vector<WorldVector<double> > worldCoords;
+
     /** \brief
      * DOFVector containing the boundary values
      */
diff --git a/AMDiS/src/ElInfo.cc b/AMDiS/src/ElInfo.cc
index 3d194ced5d7055e1965812dd20a3737db29e382f..62a422c963cf1a5f2c879421d5e4ad5e413d221a 100644
--- a/AMDiS/src/ElInfo.cc
+++ b/AMDiS/src/ElInfo.cc
@@ -62,8 +62,8 @@ namespace AMDiS {
   {
     int dim = l.getSize() - 1;
 
-    static WorldVector<double> world[4];
-    WorldVector<double> *ret = w ? w : &world[omp_get_thread_num()];
+    static WorldVector<double> world;
+    WorldVector<double> *ret = w ? w : &world;
     double c = l[0];
 
     for (int j = 0; j < dimOfWorld; j++)
diff --git a/AMDiS/src/ProblemVec.cc b/AMDiS/src/ProblemVec.cc
index 6a32fc54d1e5ded7de807b52e01a8e3bab32a5b2..01edc84146e3f7f11b0064781209965764bf645e 100644
--- a/AMDiS/src/ProblemVec.cc
+++ b/AMDiS/src/ProblemVec.cc
@@ -764,13 +764,14 @@ namespace AMDiS {
 	if (solution_->getDOFVector(i)->getBoundaryManager())
 	  solution_->getDOFVector(i)->getBoundaryManager()->
 	    fillBoundaryConditions(elInfo, solution_->getDOFVector(i));
+
 	elInfo = stack.traverseNext(elInfo);
       }
-      
+
       if (rhs_->getDOFVector(i)->getBoundaryManager())
 	rhs_->getDOFVector(i)->getBoundaryManager()->exitVector(rhs_->getDOFVector(i));
       if (solution_->getDOFVector(i)->getBoundaryManager())
-      solution_->getDOFVector(i)->getBoundaryManager()->exitVector(solution_->getDOFVector(i));    
+	solution_->getDOFVector(i)->getBoundaryManager()->exitVector(solution_->getDOFVector(i));    
     }
 
 #ifdef _OPENMP
@@ -939,9 +940,16 @@ namespace AMDiS {
   {
     Mesh *mesh = feSpace->getMesh();
     const BasisFunction *basisFcts = feSpace->getBasisFcts();
+
+#ifdef _OPENMP
     TraverseParallelStack stack;
+#else
+    TraverseStack stack;
+#endif   
 
+#ifdef _OPENMP
 #pragma omp parallel
+#endif
     {
       BoundaryType *bound = useGetBound_ ? GET_MEMORY(BoundaryType, basisFcts->getNumber()) : NULL;
 
@@ -1004,7 +1012,9 @@ namespace AMDiS {
       // the same time.
 
       if (matrix) {
+#ifdef _OPENMP
 #pragma omp critical
+#endif
 	{
 	  addDOFMatrix(matrix, tmpMatrix);
 
@@ -1016,7 +1026,9 @@ namespace AMDiS {
       }
 
       if (vector) {
+#ifdef _OPENMP
 #pragma omp critical
+#endif
 	*vector += *tmpVector;
 
 	DELETE tmpVector;