diff --git a/bin/mpirunDebug b/bin/mpirunDebug
index eec151343913e5d51231b27460339c41203956e2..013a63997fb00b09004726d0183314f8deb4d40c 100755
--- a/bin/mpirunDebug
+++ b/bin/mpirunDebug
@@ -76,9 +76,9 @@ echo "run $args" > $HOME/gdbCommands
 echo "where" >> $HOME/gdbCommands
 echo "Constructed gdb initialization file $HOME/gdbCommands"
 
-$ECHO "Choose running method: 1)gdb+xterm  2)gdb  3)log  4)xterm+valgrind: \c"
+$ECHO "Choose running method: 1)gdb+xterm  2)gdb  3)log  4)log+xterm  5)xterm+valgrind: \c"
 read method
-if [ "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 ]; then
+if [ "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 -a "$method" -ne 5 ]; then
     printUsage
     exit 1
 fi
@@ -152,6 +152,9 @@ do
         echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile
         echo "${node}$procCmdFile" >> $HOME/mpirun.schema
     elif [ "$method" -eq 4 ]; then
+        echo "$sourceFoam; cd $PWD; $exec $args 2>&1 | tee $procLog; read dummy" >> $procCmdFile
+        echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
+    elif [ "$method" -eq 5 ]; then
         echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile
         echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
     fi
diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C
index db392d9137355c9047c326214041e68c5f3100a0..bc9794e06af9ce08d0cf62e55cd9f52cfd84a5bb 100644
--- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C
+++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C
@@ -169,7 +169,7 @@ Foam::PackedList<1> Foam::syncTools::getMasterPoints(const polyMesh& mesh)
             else
             {
                 FatalErrorIn("syncTools::getMasterPoints(const polyMesh&)")
-                    << "Cannot handle patch " << patches[patchI].name()
+                    << "Cannot handle coupled patch " << patches[patchI].name()
                     << " of type " <<  patches[patchI].type()
                     << abort(FatalError);
             }
@@ -290,7 +290,7 @@ Foam::PackedList<1> Foam::syncTools::getMasterEdges(const polyMesh& mesh)
             else
             {
                 FatalErrorIn("syncTools::getMasterEdges(const polyMesh&)")
-                    << "Cannot handle patch " << patches[patchI].name()
+                    << "Cannot handle coupled patch " << patches[patchI].name()
                     << " of type " <<  patches[patchI].type()
                     << abort(FatalError);
             }
@@ -314,6 +314,54 @@ Foam::PackedList<1> Foam::syncTools::getMasterEdges(const polyMesh& mesh)
 }
 
 
+// Determines for every face whether it is coupled and if so sets only one.
+Foam::PackedList<1> Foam::syncTools::getMasterFaces(const polyMesh& mesh)
+{
+    PackedList<1> isMasterFace(mesh.nFaces(), 1);
+
+    const polyBoundaryMesh& patches = mesh.boundaryMesh();
+
+    forAll(patches, patchI)
+    {
+        if (patches[patchI].coupled())
+        {
+            if (Pstream::parRun() && isA<processorPolyPatch>(patches[patchI]))
+            {
+                const processorPolyPatch& pp =
+                    refCast<const processorPolyPatch>(patches[patchI]);
+
+                if (!pp.owner())
+                {
+                    forAll(pp, i)
+                    {
+                        isMasterFace.set(pp.start()+i, 0);
+                    }
+                }
+            }
+            else if (isA<cyclicPolyPatch>(patches[patchI]))
+            {
+                const cyclicPolyPatch& pp =
+                    refCast<const cyclicPolyPatch>(patches[patchI]);
+
+                for (label i = pp.size()/2; i < pp.size(); i++)
+                {
+                    isMasterFace.set(pp.start()+i, 0);
+                }
+            }
+            else
+            {
+                FatalErrorIn("syncTools::getMasterFaces(const polyMesh&)")
+                    << "Cannot handle coupled patch " << patches[patchI].name()
+                    << " of type " <<  patches[patchI].type()
+                    << abort(FatalError);
+            }
+        }
+    }
+
+    return isMasterFace;
+}
+
+
 template <>
 void Foam::syncTools::separateList
 (
diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H
index 608d3bd2ba53c02d3f712084cbac27f34eb1f2fe..7312e08e551a539c729f67280a2bfb24d2eef5e1 100644
--- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H
+++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H
@@ -226,9 +226,12 @@ public:
             //- Get per point whether is it master (of a coupled set of points)
             static PackedList<1> getMasterPoints(const polyMesh&);
 
-            //- Get per edge whether is it master (of a coupled set of edge)
+            //- Get per edge whether is it master (of a coupled set of edges)
             static PackedList<1> getMasterEdges(const polyMesh&);
 
+            //- Get per face whether is it master (of a coupled set of faces)
+            static PackedList<1> getMasterFaces(const polyMesh&);
+
 };
 
 
diff --git a/src/OpenFOAM/primitives/contiguous/contiguous.H b/src/OpenFOAM/primitives/contiguous/contiguous.H
index 2413b67127ad43397e1b76d797512d705d342e08..d634bb0b603178f45e7d81c7351e931314761279 100644
--- a/src/OpenFOAM/primitives/contiguous/contiguous.H
+++ b/src/OpenFOAM/primitives/contiguous/contiguous.H
@@ -47,34 +47,52 @@ namespace Foam
 
 // Assume the data associated with type T is not contiguous
 template<class T>
-inline bool contiguous()              {return false;}
+inline bool contiguous()                        {return false;}
 
 
 // Specify data associated with primitive types is contiguous
 
 template<>
-inline bool contiguous<bool>()        {return true;}
+inline bool contiguous<bool>()                  {return true;}
 
 template<>
-inline bool contiguous<char>()        {return true;}
+inline bool contiguous<char>()                  {return true;}
 
 template<>
-inline bool contiguous<short>()       {return true;}
+inline bool contiguous<unsigned char>()         {return true;}
 
 template<>
-inline bool contiguous<int>()         {return true;}
+inline bool contiguous<short>()                 {return true;}
 
 template<>
-inline bool contiguous<long>()        {return true;}
+inline bool contiguous<unsigned short>()        {return true;}
 
 template<>
-inline bool contiguous<float>()       {return true;}
+inline bool contiguous<int>()                   {return true;}
 
 template<>
-inline bool contiguous<double>()      {return true;}
+inline bool contiguous<unsigned int>()          {return true;}
 
 template<>
-inline bool contiguous<long double>() {return true;}
+inline bool contiguous<long>()                  {return true;}
+
+template<>
+inline bool contiguous<unsigned long>()         {return true;}
+
+template<>
+inline bool contiguous<long long>()             {return true;}
+
+template<>
+inline bool contiguous<unsigned long long>()    {return true;}
+
+template<>
+inline bool contiguous<float>()                 {return true;}
+
+template<>
+inline bool contiguous<double>()                {return true;}
+
+template<>
+inline bool contiguous<long double>()           {return true;}
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/conversion/polyDualMesh/polyDualMesh.C b/src/conversion/polyDualMesh/polyDualMesh.C
index 10434aba22d9eac92409c6251e10996a723ad7be..6a776e3b8319a9aa7c3d075d3894913b69174c2e 100644
--- a/src/conversion/polyDualMesh/polyDualMesh.C
+++ b/src/conversion/polyDualMesh/polyDualMesh.C
@@ -746,8 +746,7 @@ void Foam::polyDualMesh::calcDual
         allBoundary.meshEdges
         (
             mesh.edges(),
-            mesh.cellEdges(),
-            SubList<label>(mesh.faceOwner(), allBoundary.size(), nIntFaces)
+            mesh.pointEdges()
         )
     );