diff --git a/applications/utilities/miscellaneous/patchSummary/Make/files b/applications/utilities/miscellaneous/patchSummary/Make/files
index 62485dc33de9161e3fb50271da07a5a003cacf22..d25fe7a646cb0b7f7a252f2dde3223dd8a2df6ac 100644
--- a/applications/utilities/miscellaneous/patchSummary/Make/files
+++ b/applications/utilities/miscellaneous/patchSummary/Make/files
@@ -1,3 +1,3 @@
 patchSummary.C
 
-EXE = $(FOAM_USER_APPBIN)/patchSummary
+EXE = $(FOAM_APPBIN)/patchSummary
diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
index 711894666649608a81054774c08b5778c1e3b0a7..3d11eaa05e457b9c7e195a9dfc942a42a1cf2459 100644
--- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
@@ -29,6 +29,27 @@ Description
     Automatically decomposes a mesh and fields of a case for parallel
     execution of OpenFOAM.
 
+Usage
+
+    - decomposePar [OPTION]
+
+    @param -cellDist \n
+    Write the cell distribution as a labelList for use with 'manual'
+    decomposition method and as a volScalarField for post-processing.
+
+    @param -copyUniform \n
+    Copy any @a uniform directories too.
+
+    @param -fields \n
+    Use existing geometry decomposition and convert fields only.
+
+    @param -filterPatches \n
+    Remove empty patches when decomposing the geometry.
+
+    @param -force \n
+    Remove any existing @a processor subdirectories before decomposing the
+    geometry.
+
 \*---------------------------------------------------------------------------*/
 
 #include "OSspecific.H"
@@ -54,23 +75,76 @@ Description
 int main(int argc, char *argv[])
 {
     argList::noParallel();
-    argList::validOptions.insert("fields", "");
     argList::validOptions.insert("cellDist", "");
-    argList::validOptions.insert("filterPatches", "");
     argList::validOptions.insert("copyUniform", "");
+    argList::validOptions.insert("fields", "");
+    argList::validOptions.insert("filterPatches", "");
+    argList::validOptions.insert("force", "");
 
 #   include "setRootCase.H"
 
-    bool decomposeFieldsOnly(args.options().found("fields"));
     bool writeCellDist(args.options().found("cellDist"));
-    bool filterPatches(args.options().found("filterPatches"));
     bool copyUniform(args.options().found("copyUniform"));
+    bool decomposeFieldsOnly(args.options().found("fields"));
+    bool filterPatches(args.options().found("filterPatches"));
+    bool forceOverwrite(args.options().found("force"));
 
 #   include "createTime.H"
 
     Info<< "Time = " << runTime.timeName() << endl;
 
-    Info<< "Create mesh\n" << endl;
+    // determine the existing processor count directly
+    label nProcs = 0;
+    while (dir(runTime.path()/(word("processor") + name(nProcs))))
+    {
+        ++nProcs;
+    }
+
+    // Check for previously decomposed case first
+    if (decomposeFieldsOnly)
+    {
+        if (!nProcs)
+        {
+            FatalErrorIn(args.executable())
+                << "Specifying -fields requires a decomposed geometry!"
+                << nl
+                << exit(FatalError);
+        }
+    }
+    else
+    {
+        if (nProcs)
+        {
+            if (forceOverwrite)
+            {
+                Info<< "Removing " << nProcs
+                    << " existing processor directories" << endl;
+
+                // remove existing processor dirs
+                for (label procI = nProcs-1; procI >= 0; --procI)
+                {
+                    fileName procDir
+                    (
+                        runTime.path()/(word("processor") + name(procI))
+                    );
+
+                    rmDir(procDir);
+                }
+            }
+            else
+            {
+                FatalErrorIn(args.executable())
+                    << "Case is already decomposed, "
+                        "use the -force option or manually remove" << nl
+                    << "processor directories before decomposing. e.g.," << nl
+                    << "    rm -rf " << runTime.path().c_str() << "/processor*"
+                    << nl
+                    << exit(FatalError);
+            }
+        }
+    }
+
+    Info<< "Create mesh" << endl;
     domainDecomposition mesh
     (
         IOobject
@@ -84,16 +158,6 @@ int main(int argc, char *argv[])
     // Decompose the mesh
     if (!decomposeFieldsOnly)
     {
-        if (dir(runTime.path()/"processor1"))
-        {
-            FatalErrorIn(args.executable())
-                << "Case is already decomposed." << endl
-                << "    Please remove processor directories before "
-                   "decomposing e.g. using:" << nl
-                << "    rm -rf " << runTime.path().c_str() << "/processor*"
-                << exit(FatalError);
-        }
-
         mesh.decomposeMesh(filterPatches);
 
         mesh.writeDecomposition();
@@ -102,7 +166,9 @@ int main(int argc, char *argv[])
         {
             // Write the decomposition as labelList for use with 'manual'
             // decomposition method.
-            OFstream str
+
+            // FIXME: may attempt to write to a non-existent "region0/"
+            OFstream os
             (
                 runTime.path()
               / mesh.facesInstance()
@@ -110,11 +176,11 @@ int main(int argc, char *argv[])
               / "cellDecomposition"
             );
 
-            str << mesh.cellToProc();
+            os << mesh.cellToProc();
 
-            Info<< nl << "Written decomposition to "
-                << str.name() << " for use in manual decomposition."
-                << nl << endl;
+            Info<< nl << "Wrote decomposition to "
+                << os.name() << " for use in manual decomposition."
+                << endl;
 
             // Write as volScalarField for postprocessing.
             volScalarField cellDist
@@ -140,9 +206,9 @@ int main(int argc, char *argv[])
 
             cellDist.write();
 
-            Info<< nl << "Written decomposition as volScalarField to "
+            Info<< nl << "Wrote decomposition as volScalarField to "
                 << cellDist.name() << " for use in postprocessing."
-                << nl << endl;
+                << endl;
         }
     }
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options
index c7d4d25e8be7a951c6f3758599485ed8001f82a8..0652ffc64694c7223ea4b2c990aa047362987804 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options
@@ -1,5 +1,5 @@
 EXE_INC = \
-    -DFULLDEBUG -g -O0 \
+    /* -DFULLDEBUG -g -O0 */ \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/lagrangian/basic/lnInclude
 
diff --git a/doc/Doxygen/tools/find-longlines b/doc/Doxygen/tools/find-longlines
index c5294715d8c3a6e878fa1098f99e9bd68e1c73f6..424cd91cd289c283f928e2297ec4268d8cb2f052 100755
--- a/doc/Doxygen/tools/find-longlines
+++ b/doc/Doxygen/tools/find-longlines
@@ -31,7 +31,7 @@ sub wanted {
         if ( $maxlen < length ) {
             $count++;
             substr( $_, $maxlen, 0 ) = "||->>";    # show truncation point
-            print "$ARGV $. $_\n";
+            print "$File::Find::name  $. $_\n";
         }
     }
     close ARGV;
diff --git a/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C b/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C
index 6e647c9ca5e9eb47e53195a99ef88c720e62dafa..37dfdb7ad3577d7f2adeb221de1fa3c305b0ae67 100644
--- a/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C
+++ b/src/OpenFOAM/db/IOobject/IOobjectWriteHeader.C
@@ -52,7 +52,7 @@ bool Foam::IOobject::writeHeader(Ostream& os) const
     // outdent for visibility and more space
     if (note().size())
     {
-        os  << "    note    " << note() << ";\n";
+        os  << "    note        " << note() << ";\n";
     }
 
     os  << "    location    " << instance()/local() << ";\n"
diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOmanip.H b/src/OpenFOAM/db/IOstreams/IOstreams/IOmanip.H
index 0eb8ee6ce89db506abc498d3707f3b3d29888580..30f8efcf340d9b2c8ebfc4f86408766a4845be60 100644
--- a/src/OpenFOAM/db/IOstreams/IOstreams/IOmanip.H
+++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOmanip.H
@@ -170,19 +170,28 @@ inline Smanip<ios_base::fmtflags> setf
 }
 
 
-inline Omanip<IOstream::streamFormat> setformat(const IOstream::streamFormat fmt)
+inline Omanip<IOstream::streamFormat> setformat
+(
+    const IOstream::streamFormat fmt
+)
 {
     return Omanip<IOstream::streamFormat>(&IOstream::format, fmt);
 }
 
 
-inline Omanip<IOstream::versionNumber> setversion(const IOstream::versionNumber ver)
+inline Omanip<IOstream::versionNumber> setversion
+(
+    const IOstream::versionNumber ver
+)
 {
     return Omanip<IOstream::versionNumber>(&IOstream::version, ver);
 }
 
 
-inline Omanip<IOstream::compressionType> setcompression(const IOstream::compressionType cmp)
+inline Omanip<IOstream::compressionType> setcompression
+(
+    const IOstream::compressionType cmp
+)
 {
     return Omanip<IOstream::compressionType>(&IOstream::compression, cmp);
 }
diff --git a/src/OpenFOAM/db/Time/timeSelector.H b/src/OpenFOAM/db/Time/timeSelector.H
index ea5fdb5106f6e0994db380ee63df0fbde79e04bf..7d1f15fda1dd18115029487823a587cb2c84272f 100644
--- a/src/OpenFOAM/db/Time/timeSelector.H
+++ b/src/OpenFOAM/db/Time/timeSelector.H
@@ -117,7 +117,7 @@ public:
         //- Select a list of Time values that are within the ranges
         void inplaceSelect(List<instant>&) const;
 
-        //- Add the set of options handled by timeSelector to argList::validOptions
+        //- Add the options handled by timeSelector to argList::validOptions
         //
         // @param constant
         //   Add the @b -constant option to include the @c constant/ directory
diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H
index f79d6d5d1712a1369eaf9725a4c79fdd34603179..648295da842bb5414ecdeeff1d507137d775c4a0 100644
--- a/src/OpenFOAM/global/argList/argList.H
+++ b/src/OpenFOAM/global/argList/argList.H
@@ -198,7 +198,7 @@ public:
                 return globalCase_;
             }
 
-            //- Return case name for parallel run or the global case for a serial run
+            //- Return case name (parallel run) or global case (serial run)
             const fileName& caseName() const
             {
                 return case_;
diff --git a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H
index 6238dcc387f5082d49f54735d05352411ecce65f..417129ba82bb6be1560e429ebf9013aa989655d7 100644
--- a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H
+++ b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H
@@ -36,7 +36,7 @@ Description
     Does a very simple scheduling which assumes same time for all operations.
 
     After construction:
-      - schedule() gives the order in which the input communication should happen
+      - schedule() gives the order in which the input communication should occur
       - procSchedule()[procI] gives per procI
 
     Does not care whether 'talking' is first send, second receive or maybe
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H
index df98c1c24bf0e01dd38e698918caa305c8cd1f7c..f433a2701bcf49ed3775a4bc04f48b838c450acb 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H
@@ -90,7 +90,7 @@ inline const labelList& objectMap::masterObjects() const
 }
 
 
-// * * * * * * * * * * * * * * * * Frimaster Operators  * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * //
 
 inline bool operator==(const objectMap& a, const objectMap& b)
 {
diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C
index bc0ffe26c5db8c252bd6bd67e7aa008991aede31..beb766af16ab9ebc0e677f4c35dcee5618c89db2 100644
--- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C
+++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C
@@ -641,7 +641,7 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
                     }
                 }
             }
-            else if (refineCell[own] != -1)
+            else if (refineCell[own] == -1)
             {
                 // boundary face with unmarked owner
 
@@ -658,18 +658,25 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
 
                 if (surfI != -1)
                 {
-                    if
-                    (
-                       !markForRefine
+                    // Make sure it is my side that wants refinement.
+                    label surfaceMinLevel =
+                        surfaces_.minLevelField(surfI)[hit.index()];
+                   
+                    if (surfaceMinLevel > cellLevel[own])
+                    {
+                        if
                         (
-                            surfI,
-                            nAllowRefine,
-                            refineCell[own],
-                            nRefine
+                           !markForRefine
+                            (
+                                surfI,
+                                nAllowRefine,
+                                refineCell[own],
+                                nRefine
+                            )
                         )
-                    )
-                    {
-                        break;
+                        {
+                            break;
+                        }
                     }
                 }
             }
diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler
index 14f4d9040284cdcd1b3b4720d3c718cd0c36a4f4..241f2502d1a0a43461860ac6c5492e7f639b0db8 100755
--- a/wmake/wmakeScheduler
+++ b/wmake/wmakeScheduler
@@ -137,16 +137,6 @@ done
 # is returned and not of colouring pipe.
 set -o pipefail
 
-# Define function to colour output by argument 1
-colourPipe(){
-    if [ "$1" ]; then
-        (while read line; do setterm -foreground $1; echo "$line" ; done; setterm -foreground default)
-    else
-        cat
-    fi
-}
-
-
 colourIndex=0
 
 while :
@@ -164,26 +154,28 @@ do
         do
             lockFile="$lockDir/$host:$i"
             if lockfile -r0 "$lockFile" 2>/dev/null; then
-                # Set colour
-                colour=${colours[$colourIndex]}
-                ## echo "** host=$host  colourIndex=$colourIndex  colour=$colour"
-
-                if [ "$host" = "$HOST" ]; then
-                    if [ "$colour" ]; then
-                        eval $* 2>&1 | colourPipe $colour
+                if [ "$WM_COLOURS" ]; then
+                    # Set colour
+                    colourString=`setterm -foreground ${colours[$colourIndex]}`
+
+                    if [ "$host" = "$HOST" ]; then
+                        eval $* 2>&1 | sed -e "s/^/$colourString/"
+                    elif [ -n "$JOB_ID" ]; then
+                        qrsh -inherit -v PWD $host "$rcmd"
                     else
-                        eval $*
+                        ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | sed -e "s/^/$colourString/"
                     fi
-                elif [ -n "$JOB_ID" ]; then
-                    qrsh -inherit -v PWD $host "$rcmd"
+                    retval=$?
                 else
-                    if [ "$colour" ]; then
-                        ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe $colour
+                    if [ "$host" = "$HOST" ]; then
+                        eval $*
+                    elif [ -n "$JOB_ID" ]; then
+                        qrsh -inherit -v PWD $host "$rcmd"
                     else
                         ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd"
                     fi
+                    retval=$?
                 fi
-                retval=$?
 
                 # Release lock
                 rm -f "$lockFile" 2>/dev/null