diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModel.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModel.C
index fa3feada4ae0e704730f153470baec74716e1ef5..e1b7119f19ac2a03409001ad59e5f7ee92919e69 100644
--- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModel.C
+++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModel.C
@@ -27,6 +27,7 @@ License
 
 #include "mixtureViscosityModel.H"
 #include "volFields.H"
+#include "surfaceMesh.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
index 556bfc2057973f5850caaba7ba786bc38e1653f6..43b3553b563c29b6d07133b6bd304d539ee371db 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
@@ -26,6 +26,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "phaseChangeTwoPhaseMixture.H"
+#include "surfaceMesh.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
index b6a245fb549f4e3518f90dc32c9aee262ae17691..eb7b80d04d8d2f2d58e839aa9899df4c392947a4 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
@@ -28,6 +28,7 @@ License
 
 #include "phaseChangeTwoPhaseMixture.H"
 #include "incompressibleTwoPhaseMixture.H"
+#include "surfaceMesh.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C
index 4f7957a8d1d50e6446d0689782f38e7c9ba1a898..e4576b87aa1db1f616dd895ba7f1dc1dff1e9a2f 100644
--- a/src/combustionModels/combustionModel/combustionModelTemplates.C
+++ b/src/combustionModels/combustionModel/combustionModelTemplates.C
@@ -73,9 +73,6 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
             << "combustion model " << combModelName << "." << endl;
     }
 
-    typedef typename CombustionModel::dictionaryConstructorTable cstrTableType;
-    cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_;
-
     const word compCombModelName
     (
         combModelName + '<' + CombustionModel::reactionThermo::typeName + '>'
@@ -87,9 +84,12 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
       + thermo.thermoName() + '>'
     );
 
-    auto compCstrIter = cstrTable->cfind(compCombModelName);
 
-    auto thermoCstrIter = cstrTable->cfind(thermoCombModelName);
+    const auto& cnstrTable = *(CombustionModel::dictionaryConstructorTablePtr_);
+
+    auto compCstrIter = cnstrTable.cfind(compCombModelName);
+
+    auto thermoCstrIter = cnstrTable.cfind(thermoCombModelName);
 
     if (!compCstrIter.found() && !thermoCstrIter.found())
     {
@@ -129,7 +129,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
             })
         );
 
-        for (const word& validName : cstrTable->sortedToc())
+        for (const word& validName : cnstrTable.sortedToc())
         {
             wordList cmpts(basicThermo::splitThermoName(validName, 2));
 
@@ -163,7 +163,7 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
         (
             combustionModel::typeName,
             combModelName,
-            *cstrTable
+            cnstrTable
         )
             << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1]
             << " combinations are:" << nl << nl;
diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFields.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFields.C
index ab5f0362a7cefb0f2febde4ef5beb0613efaf2b2..72a2cd35973667967237d7c77c4bab00f7277384 100644
--- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFields.C
+++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchFields.C
@@ -26,6 +26,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "faPatchFields.H"
+#include "areaFaMesh.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFields.C b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFields.C
index 639cf16a2986535f4341fd5fc457a48f9ef0dd06..99c429b92495fa921e169415d1a5846a7bdeddb5 100644
--- a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFields.C
+++ b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchFields.C
@@ -23,12 +23,10 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-Description
-    Finite area edge-based patch fields
-
 \*---------------------------------------------------------------------------*/
 
 #include "faePatchFields.H"
+#include "edgeFaMesh.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/meshTools/PatchFunction1/makePatchFunction1s.C b/src/meshTools/PatchFunction1/makePatchFunction1s.C
index b26fc4e509b5136248cf25c06a622b23dd7dd411..88aa2946d91e5707f0d735601d72843a6ee9ff75 100644
--- a/src/meshTools/PatchFunction1/makePatchFunction1s.C
+++ b/src/meshTools/PatchFunction1/makePatchFunction1s.C
@@ -33,6 +33,8 @@ License
 #include "addToRunTimeSelectionTable.H"
 #include "Table.H"
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 #define makePatchFunction1s(Type)                                              \
     makePatchFunction1(Type);                                                  \
     makePatchFunction1Type(ConstantField, Type);                               \
@@ -124,42 +126,30 @@ namespace Foam
     ////  This does not work because we cannot guarantee that the Function1
     ////  static initialisation has happened already.
     //template<class Type>
-    //class addToUniform
+    //struct addToUniform
     //{
-    //public:
     //    addToUniform()
     //    {
     //        // Get the Function1 table
-    //        typedef typename Function1<Type>::dictionaryConstructorTable
-    //            F1Type;
     //        Function1<Type>::constructdictionaryConstructorTables();
-    //        const F1Type& F1Table =
+    //        const auto& F1Table =
     //            *Function1<Type>::dictionaryConstructorTablePtr_;
     //
     //        // Get the PatchFunction1 table
-    //        typedef typename PatchFunction1<Type>::dictionaryConstructorTable
-    //            PF1Type;
-    //
     //        PatchFunction1<Type>::constructdictionaryConstructorTables();
-    //        PF1Type& PF1Table =
+    //        auto& PF1Table =
     //            *PatchFunction1<Type>::dictionaryConstructorTablePtr_;
     //
     //        // Get the UniformValueField constructor
-    //        auto cstrIter =
-    //            PatchFunction1<Type>::dictionaryConstructorTablePtr_->cfind
-    //            (
-    //                PatchFunction1Types::UniformValueField<Type>::typeName
-    //            );
+    //        auto cstrIter = PF1Table.cfind
+    //        (
+    //            PatchFunction1Types::UniformValueField<Type>::typeName
+    //        );
     //
     //        // Add the UniformValueField under the Function1 name
     //        forAllConstIters(F1Table, iter)
     //        {
-    //            //bool ok =
     //            PF1Table.insert(iter.key(), cstrIter());
-    //            //if (!ok)
-    //            //{
-    //            //    std::cout<< "** problem" << std::endl;
-    //            //}
     //        }
     //    }
     //};
diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C
index dbbb2ee4c4c2e65270149e136744b2270d079575..55f81cd01c2fd849b2676ee3b8c45b227e160113 100644
--- a/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C
+++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/optimisationType/incompressible/optimisationType/optimisationTypeIncompressible.C
@@ -86,18 +86,17 @@ optimisationType::optimisationType
      && !isA<constrainedOptimisationMethod>(updateMethod_())
     )
     {
+        const auto& cnstrTable =
+            *(constrainedOptimisationMethod::dictionaryConstructorTablePtr_);
+
         // Has constraints but is not a constraint optimisation method
-        auto cstTablePtr
-        (
-            constrainedOptimisationMethod::dictionaryConstructorTablePtr_
-        );
         FatalErrorInFunction
             << "Found " << nConstraints << " adjoint solvers corresponding to "
-            << "constraints but the optimisation method used "
-            << "(" << updateMethod_().type() << ") "
-            << "is not a constrainedOptimisationMethod. " << nl
-            << "Available constrainedOptimisationMethods are :" << nl
-            << cstTablePtr->sortedToc()
+            << "constraints but the optimisation method ("
+            << updateMethod_().type()
+            << ") is not a constrainedOptimisationMethod." << nl
+            << "Available constrainedOptimisationMethods:" << nl
+            << cnstrTable.sortedToc()
             << exit(FatalError);
     }
     else if
@@ -109,9 +108,9 @@ optimisationType::optimisationType
         // Does not have constraints but is a constrained optimisation method
         WarningInFunction
             << "Did not find any adjoint solvers corresponding to "
-            << "constraints but the optimisation method used "
-            << "(" << updateMethod_().type() << ") "
-            << "is a constrainedOptimisationMethod. " << nl << nl
+            << "constraints but the optimisation method ("
+            << updateMethod_().type()
+            << ") is a constrainedOptimisationMethod." << nl << nl
             << "This can cause some constraintOptimisationMethods to misbehave."
             << nl << nl
             << "Either the isConstraint bool is not set in one of the adjoint "
diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C
index d642dbc880149c0a3189abcc37d16173dfd7c29e..b6293541dd408d00a4888192f7abdf797fa22fd0 100644
--- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C
+++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C
@@ -93,7 +93,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
 
     Info<< "Selecting chemistry solver " << chemistryTypeDictNew << endl;
 
-    auto* cstrTable = ChemistryModel::thermoConstructorTablePtr_;
+    const auto& cnstrTable = *(ChemistryModel::thermoConstructorTablePtr_);
 
     const word chemSolverCompThermoName
     (
@@ -102,7 +102,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
       + thermo.thermoName() + ">>"
     );
 
-    auto cstrIter = cstrTable->cfind(chemSolverCompThermoName);
+    auto cstrIter = cnstrTable.cfind(chemSolverCompThermoName);
 
     if (!cstrIter.found())
     {
@@ -142,7 +142,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
             })
         );
 
-        for (const word& validName : cstrTable->sortedToc())
+        for (const word& validName : cnstrTable.sortedToc())
         {
             validCmpts.append
             (
diff --git a/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemes.H b/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemes.H
index 5ea5a43486e2d8baaf11e25a7588711a2dca2242..d36c3597b142f4d325a06e2d606d189fe0f287a7 100644
--- a/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemes.H
+++ b/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemes.H
@@ -41,6 +41,7 @@ SourceFiles
 #include "runTimeSelectionTables.H"
 #include "dimensionedScalar.H"
 #include "volFields.H"
+#include "surfaceFields.H"
 #include "IOdictionary.H"
 #include "DynamicField.H"
 #include "MeshedSurface.H"
diff --git a/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C b/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C
index 7891acdc15dd50792d3d3f3fd334429000b0223e..20a9f037978f51998d280d495d1fffb74905267d 100644
--- a/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C
+++ b/src/transportModels/geometricVoF/reconstructionSchemes/reconstructionSchemesNew.C
@@ -26,7 +26,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "reconstructionSchemes.H"
-#include "messageStream.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //