diff --git a/applications/utilities/mesh/conversion/sammToFoam/readCells.C b/applications/utilities/mesh/conversion/sammToFoam/readCells.C
index 698286cbe553c9c540754c98328cd0f22548e987..81385923b84fee4a25ac9c6e3fda48d7242464bb 100644
--- a/applications/utilities/mesh/conversion/sammToFoam/readCells.C
+++ b/applications/utilities/mesh/conversion/sammToFoam/readCells.C
@@ -230,7 +230,7 @@ void sammMesh::readCells()
     {
         IFstream cellsFile(cellsFileName);
 
-        labelList labels(24, -1);
+        labelList labels(24, label(-1));
         label lineLabel, sammLabel, regionLabel, typeFlag;
 
         for (label cellI = 0; cellI < nCells; cellI++)
diff --git a/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C b/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C
index f259ae36fa55c13af2ab9382e8e000ffbbe0c414..0b4fd11ddbc9043136de296d02fcb817a58ef180 100644
--- a/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C
+++ b/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C
@@ -47,7 +47,7 @@ void starMesh::readBoundary()
     labelList pointLabels(4);
     labelList pointLabelsTri(3);
 
-    labelList patchLabels(1000, -1);
+    labelList patchLabels(1000, label(-1));
 
     word patchType;
     patchTypes_.setSize(1000);
diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C
index 6d3c44b8adec04d0601be73c8f66dba45154a3b6..1451233254467baca3af1d816abb1fbf15c298aa 100644
--- a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C
+++ b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C
@@ -244,8 +244,8 @@ void Foam::domainDecomposition::decomposeMesh()
     {
         label nInterfaces = interPatchFaces[procI].size();
 
-        subPatchIDs[procI].setSize(nInterfaces, labelList(1, -1));
-        subPatchStarts[procI].setSize(nInterfaces, labelList(1, 0));
+        subPatchIDs[procI].setSize(nInterfaces, labelList(1, label(-1)));
+        subPatchStarts[procI].setSize(nInterfaces, labelList(1, label(0)));
     }
 
     // Processor boundaries from split cyclics
@@ -319,7 +319,7 @@ void Foam::domainDecomposition::decomposeMesh()
             {
                 label nIntfcs = interPatchFaces[procI].size();
                 subPatchIDs[procI].setSize(nIntfcs, labelList(1, patchi));
-                subPatchStarts[procI].setSize(nIntfcs, labelList(1, 0));
+                subPatchStarts[procI].setSize(nIntfcs, labelList(1, label(0)));
             }
         }
     }
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C
index 19dd60f1e81550a0a9012e4e9bcd12e50ef5deec..7058ac6139a743f21275146b44df4aa149113a7b 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C
@@ -24,6 +24,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "HashTable.H"
+#include "uLabel.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -47,7 +48,7 @@ Foam::label Foam::HashTableCore::canonicalSize(const label size)
     }
 
     // enforce power of two
-    unsigned int goodSize = size;
+    uLabel goodSize = size;
 
     if (goodSize & (goodSize - 1))
     {
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H
index dff96c4388c1c82dd11ab660aa6725fcea3033a2..7b4a7bfada87e9701972c8f6960518d086af1543 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H
@@ -68,7 +68,7 @@ class UIPstream
 
         const bool clearAtEnd_;
 
-        label messageSize_;
+        int messageSize_;
 
 
     // Private Member Functions
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
index 67a120afdfe169e0e27f993f7ed7ba91352b8901..a45d38589423a9d35ac3354748e8a49f42087693 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
@@ -222,7 +222,7 @@ int Foam::UPstream::myProcNo_(0);
 bool Foam::UPstream::parRun_(false);
 
 // List of process IDs
-Foam::List<int> Foam::UPstream::procIDs_(1, 0);
+Foam::List<int> Foam::UPstream::procIDs_(label(1), 0);
 
 // Standard transfer message type
 int Foam::UPstream::msgType_(1);
diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C
index 6ab3baa700d2a075f259a7755b7d8982b4a07485..754a2b90722ebdd840e6241f0f4aa8591c8952dc 100644
--- a/src/OpenFOAM/db/Time/Time.C
+++ b/src/OpenFOAM/db/Time/Time.C
@@ -278,7 +278,7 @@ Foam::Time::Time
     writeControl_(wcTimeStep),
     writeInterval_(GREAT),
     secondaryWriteControl_(wcTimeStep),
-    secondaryWriteInterval_(labelMax),
+    secondaryWriteInterval_(labelMax/10.0), // bit less to allow calculations
     purgeWrite_(0),
     writeOnce_(false),
     subCycling_(false),
@@ -370,7 +370,7 @@ Foam::Time::Time
     writeControl_(wcTimeStep),
     writeInterval_(GREAT),
     secondaryWriteControl_(wcTimeStep),
-    secondaryWriteInterval_(labelMax),
+    secondaryWriteInterval_(labelMax/10.0),
     purgeWrite_(0),
     writeOnce_(false),
     subCycling_(false),
@@ -465,7 +465,7 @@ Foam::Time::Time
     writeControl_(wcTimeStep),
     writeInterval_(GREAT),
     secondaryWriteControl_(wcTimeStep),
-    secondaryWriteInterval_(labelMax),
+    secondaryWriteInterval_(labelMax/10.0),
     purgeWrite_(0),
     writeOnce_(false),
     subCycling_(false),
@@ -562,7 +562,7 @@ Foam::Time::Time
     writeControl_(wcTimeStep),
     writeInterval_(GREAT),
     secondaryWriteControl_(wcTimeStep),
-    secondaryWriteInterval_(labelMax),
+    secondaryWriteInterval_(labelMax/10.0),
     purgeWrite_(0),
     writeOnce_(false),
     subCycling_(false),
diff --git a/src/OpenFOAM/fields/Fields/transformList/transformList.H b/src/OpenFOAM/fields/Fields/transformList/transformList.H
index a95e099249b1a63179c8044f2966dca87494fe9b..2da8e3947740d6ba836c58c8ec8f8ea52b02a79f 100644
--- a/src/OpenFOAM/fields/Fields/transformList/transformList.H
+++ b/src/OpenFOAM/fields/Fields/transformList/transformList.H
@@ -75,6 +75,28 @@ template<class T>
 void transformList(const tensorField&, EdgeMap<T>&);
 
 
+// Specialisations for bool
+template<>
+inline void transformList(const tensor&, UList<bool>&)
+{}
+template<>
+inline void transformList(const tensorField&, UList<bool>&)
+{}
+template<>
+inline void transformList(const tensor&, Map<bool>&)
+{}
+template<>
+inline void transformList(const tensorField&, Map<bool>&)
+{}
+template<>
+inline void transformList(const tensor&, EdgeMap<bool>&)
+{}
+template<>
+inline void transformList(const tensorField&, EdgeMap<bool>&)
+{}
+
+
+// Specialisations for label
 template<>
 inline void transformList(const tensor&, labelUList&)
 {}
@@ -95,6 +117,7 @@ inline void transformList(const tensorField&, EdgeMap<label>&)
 {}
 
 
+// Specialisations for scalar
 template<>
 inline void transformList(const tensor&, UList<scalar>&)
 {}
diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C
index c6a26df15e8eda927a025e441f80d27ef5ca1de0..b598acf072c6bb83c07884940fac85395ac66657 100644
--- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C
+++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C
@@ -137,7 +137,7 @@ void Foam::pointMapper::calcAddressing() const
             if (addr[pointI].empty())
             {
                 // Mapped from a dummy point. Take point 0 with weight 1.
-                addr[pointI] = labelList(1, 0);
+                addr[pointI] = labelList(1, label(0));
                 w[pointI] = scalarList(1, 1.0);
 
                 insertedPoints[nInsertedPoints] = pointI;
diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C
index f0b3fd9f6e82780754ee10eb31ddd533f56fd240..542455775fdd29a9911430e2a62f09c916391bc4 100644
--- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C
+++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C
@@ -88,7 +88,7 @@ void Foam::pointPatchMapper::calcAddressing() const
             else
             {
                 // Inserted point. Map from point0 (arbitrary choice)
-                addr[i] = labelList(1, 0);
+                addr[i] = labelList(1, label(0));
                 w[i] = scalarList(1, 1.0);
             }
         }
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C
index 37974279cbea3b2a5ea6c88997e8ad4d4302a0dd..445ba183ef39a8153da7a2ec393d80efd5d277e7 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C
@@ -202,7 +202,7 @@ void Foam::cellMapper::calcAddressing() const
             if (addr[cellI].empty())
             {
                 // Mapped from a dummy cell
-                addr[cellI] = labelList(1, 0);
+                addr[cellI] = labelList(1, label(0));
                 w[cellI] = scalarList(1, 1.0);
 
                 insertedCells[nInsertedCells] = cellI;
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C
index db90ba0dd8c8d6b48886bd8cfc8a702a3fd3d99d..e95fbe95f9149a8d439c82691291a497e1ecd68d 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C
@@ -180,7 +180,7 @@ void Foam::faceMapper::calcAddressing() const
             if (addr[faceI].empty())
             {
                 // Mapped from a dummy face
-                addr[faceI] = labelList(1, 0);
+                addr[faceI] = labelList(1, label(0));
                 w[faceI] = scalarList(1, 1.0);
 
                 insertedFaces[nInsertedFaces] = faceI;
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C
index a93587d6767ec00de4b99356db2fa04c536cc498..ff15dcea3b247615594dd44c0021f78b225da7e0 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C
@@ -147,7 +147,7 @@ bool Foam::pointZone::checkParallelSync(const bool report) const
         maxZone[pointI] = index();
         minZone[pointI] = index();
     }
-    syncTools::syncPointList(mesh, maxZone, maxEqOp<label>(), -1);
+    syncTools::syncPointList(mesh, maxZone, maxEqOp<label>(), label(-1));
     syncTools::syncPointList(mesh, minZone, minEqOp<label>(), labelMax);
 
     bool error = false;
diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C
index 99e656d8db29e0d9a3ccae8b879b79930c665312..66b556e27b58dc147ec21b3bc8a41ffa1f2ed994 100644
--- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C
+++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C
@@ -318,7 +318,7 @@ void Foam::globalIndexAndTransform::determineTransforms()
 
 void Foam::globalIndexAndTransform::determineTransformPermutations()
 {
-    label nTransformPermutations = pow(3, transforms_.size());
+    label nTransformPermutations = pow(label(3), transforms_.size());
 
     transformPermutations_.setSize(nTransformPermutations);
 
diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H
index c1cdbf91c13ce0ee8a0120e54ee9ea19c98d9271..bb72f8d43dc4bc8a0dc5b5f9ef44b0e0156d7977 100644
--- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H
+++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H
@@ -151,7 +151,7 @@ Foam::globalIndexAndTransform::decodeTransformIndex
     const label transformIndex
 ) const
 {
-    FixedList<label, 3> permutation(0);
+    FixedList<label, 3> permutation(label(0));
 
     label t = transformIndex;
     if (nIndependentTransforms() > 0)
@@ -520,7 +520,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
     }
 
     // Number of selected transformations
-    label nSelTrans = pow(2, nUsedTrans) - 1;
+    label nSelTrans = pow(label(2), nUsedTrans) - 1;
 
     // Pout<< nl << permutation << nl << endl;
 
diff --git a/src/OpenFOAM/primitives/hashes/Hash/Hash.H b/src/OpenFOAM/primitives/hashes/Hash/Hash.H
index 98766436192ac9c5d163728a7f66200ee95caefa..e5fbb2823be856f5ddd981b560563d1f1f42c921 100644
--- a/src/OpenFOAM/primitives/hashes/Hash/Hash.H
+++ b/src/OpenFOAM/primitives/hashes/Hash/Hash.H
@@ -42,6 +42,8 @@ Description
 
 namespace Foam
 {
+//template<class Type> class Hash;
+//template<> class Hash<label>;
 
 /*---------------------------------------------------------------------------*\
                             Class Hash Declaration
@@ -70,54 +72,54 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-//- Hash specialization for hashing pointer addresses.
-//  Treat a pointer like a long.
-//  This should work for both 32-bit and 64-bit pointers.
+//- Hash specialization for hashing labels
 template<>
-class Hash<void*>
+class Hash<Foam::label>
 {
 public:
 
     Hash()
     {}
 
-    unsigned operator()(const void* const& p, unsigned seed) const
+    //- Incrementally hash a label.
+    //  This will necessarily return a different value than the
+    //  non-incremental version.
+    unsigned operator()(const label p, unsigned seed) const
     {
-        return Hash<long>()(long(p), seed);
+        return Hasher(&p, sizeof(label), seed);
     }
 
-    unsigned operator()(const void* const& p) const
+    //- Return the unsigned representation of a label.
+    //  This helps if people have relied on the hash value corresponding to
+    //  the natural order.
+    unsigned operator()(const label p) const
     {
-        return Hash<long>()(long(p));
+        return p;
     }
-
 };
 
 
-//- Hash specialization for hashing labels
+//- Hash specialization for hashing pointer addresses.
+//  Treat a pointer like a long.
+//  This should work for both 32-bit and 64-bit pointers.
 template<>
-class Hash<Foam::label>
+class Hash<void*>
 {
 public:
 
     Hash()
     {}
 
-    //- Incrementally hash a label.
-    //  This will necessarily return a different value than the
-    //  non-incremental version.
-    unsigned operator()(const label p, unsigned seed) const
+    unsigned operator()(const void* const& p, unsigned seed) const
     {
-        return Hasher(&p, sizeof(label), seed);
+        return Hash<long>()(long(p), seed);
     }
 
-    //- Return the unsigned representation of a label.
-    //  This helps if people have relied on the hash value corresponding to
-    //  the natural order.
-    unsigned operator()(const label p) const
+    unsigned operator()(const void* const& p) const
     {
-        return p;
+        return Hash<long>()(long(p));
     }
+
 };
 
 
diff --git a/src/OpenFOAM/primitives/ints/label/label.C b/src/OpenFOAM/primitives/ints/label/label.C
index 389d10de472ca5647ad36b7365e3d2335451ea7c..3eec19bcf245148de02ee72f327964c9aaa834b7 100644
--- a/src/OpenFOAM/primitives/ints/label/label.C
+++ b/src/OpenFOAM/primitives/ints/label/label.C
@@ -53,6 +53,28 @@ pTraits<label>::pTraits(Istream& is)
 }
 
 
+#if (FOAM_LABEL_MAX != INT_MAX)
+const char* const pTraits<int>::typeName = "int";
+const int pTraits<int>::zero = 0;
+const int pTraits<int>::one = 1;
+const int pTraits<int>::min = INT_MIN;
+const int pTraits<int>::max = INT_MAX;
+
+const char* pTraits<int>::componentNames[] = { "x" };
+
+pTraits<int>::pTraits(const int& p)
+:
+    p_(p)
+{}
+
+
+pTraits<int>::pTraits(Istream& is)
+{
+    is >> p_;
+}
+#endif
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 // Raise one label to the power of another (overloaded function call)
diff --git a/src/OpenFOAM/primitives/ints/label/label.H b/src/OpenFOAM/primitives/ints/label/label.H
index 08878cc39ef0c4719515fdcf2df93f08bd086e3f..17911aed1f795078e80b118dce5f5fa761b34b39 100644
--- a/src/OpenFOAM/primitives/ints/label/label.H
+++ b/src/OpenFOAM/primitives/ints/label/label.H
@@ -47,6 +47,9 @@ Description
 #    define FOAM_LABEL_MAX 2000000000
 #endif
 
+#include "pTraits.H"
+#include "direction.H"
+
 
 #if INT_MAX > FOAM_LABEL_MAX
 
@@ -126,8 +129,8 @@ namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "pTraits.H"
-#include "direction.H"
+//#include "pTraits.H"
+//#include "direction.H"
 
 namespace Foam
 {
@@ -188,6 +191,66 @@ public:
 };
 
 
+// For convenience's sake always define pTraits<int> (so even if label != int)
+#if (FOAM_LABEL_MAX != INT_MAX)
+//- template specialization for pTraits<int>
+template<>
+class pTraits<int>
+{
+    int p_;
+
+public:
+
+    //- Component type
+    typedef int cmptType;
+
+    // Member constants
+
+        enum
+        {
+            dim = 3,         //!< Dimensionality of space
+            rank = 0,        //!< Rank of int is 0
+            nComponents = 1  //!< Number of components in int is 1
+        };
+
+
+    // Static data members
+
+        static const char* const typeName;
+        static const char* componentNames[];
+        static const int zero;
+        static const int one;
+        static const int min;
+        static const int max;
+
+
+    // Constructors
+
+        //- Construct from primitive
+        explicit pTraits(const int&);
+
+        //- Construct from Istream
+        pTraits(Istream&);
+
+
+    // Member Functions
+
+        //- Access to the int value
+        operator int() const
+        {
+            return p_;
+        }
+
+        //- Access to the int value
+        operator int&()
+        {
+            return p_;
+        }
+};
+#endif
+
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 //- Raise one label to the power of another
@@ -214,6 +277,7 @@ MAXMIN(char, char, char)
 MAXMIN(short, short, short)
 MAXMIN(int, int, int)
 MAXMIN(long, long, long)
+MAXMIN(long, long, int)
 MAXMIN(long long, long long, long long)
 
 MAXMIN(unsigned char, unsigned char, unsigned char)
diff --git a/src/OpenFOAM/primitives/ints/long/long.H b/src/OpenFOAM/primitives/ints/long/long.H
index 8a4df1c64850a4248e94bdbe47767c9726ca8b6f..5fbf2fa95be20354a16e9d932cda49c71e806d45 100644
--- a/src/OpenFOAM/primitives/ints/long/long.H
+++ b/src/OpenFOAM/primitives/ints/long/long.H
@@ -48,7 +48,7 @@ class Ostream;
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 //- Return a string representation of a long
-word name(long);
+word name(const long);
 
 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/ints/long/longIO.C b/src/OpenFOAM/primitives/ints/long/longIO.C
index 78398de69f3be5a1b6b1726be0bb7abdb7bb9765..3a9d8e3fe5303f1f78addb32807ad4e896dc1cbd 100644
--- a/src/OpenFOAM/primitives/ints/long/longIO.C
+++ b/src/OpenFOAM/primitives/ints/long/longIO.C
@@ -37,7 +37,7 @@ Description
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-Foam::word Foam::name(long val)
+Foam::word Foam::name(const long val)
 {
     std::ostringstream buf;
     buf << val;
diff --git a/src/OpenFOAM/primitives/ints/uLabel/uLabel.H b/src/OpenFOAM/primitives/ints/uLabel/uLabel.H
index cae98e4e367c563194dc78f13cbdf57fdd926304..2dd937d17b79f1d54b87e5cde6cab61f4546f174 100644
--- a/src/OpenFOAM/primitives/ints/uLabel/uLabel.H
+++ b/src/OpenFOAM/primitives/ints/uLabel/uLabel.H
@@ -42,9 +42,9 @@ SeeAlso
 
 
 #if FOAM_LABEL64
-#    define FOAM_ULABEL_MAX 18000000000000000000
+#    define FOAM_ULABEL_MAX 18000000000000000000u
 #else
-#    define FOAM_ULABEL_MAX 4000000000
+#    define FOAM_ULABEL_MAX 4000000000u
 #endif
 
 
diff --git a/src/OpenFOAM/primitives/transform/transform.H b/src/OpenFOAM/primitives/transform/transform.H
index a2a94c39821d428f78842d613eb9e95cfc3d4e9c..a1cb5c21140a5d3be7d1b54ae1b89358b99b4480 100644
--- a/src/OpenFOAM/primitives/transform/transform.H
+++ b/src/OpenFOAM/primitives/transform/transform.H
@@ -57,6 +57,12 @@ inline tensor rotationTensor
 }
 
 
+inline label transform(const tensor&, const bool i)
+{
+    return i;
+}
+
+
 inline label transform(const tensor&, const label i)
 {
     return i;
diff --git a/src/Pstream/mpi/UIPread.C b/src/Pstream/mpi/UIPread.C
index ba2d8ced8ac84bd0a457210262779eded9308c3a..bcc6f4c41286d1cdbf34734d05a923424bee025e 100644
--- a/src/Pstream/mpi/UIPread.C
+++ b/src/Pstream/mpi/UIPread.C
@@ -259,7 +259,7 @@ Foam::label Foam::UIPstream::read
 
         // Check size of message read
 
-        label messageSize;
+        int messageSize;
         MPI_Get_count(&status, MPI_BYTE, &messageSize);
 
         if (debug)
diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C
index d3fc2a2e0accfc477f4ee27f60051b679a5e62b1..f092147a1dbff8e510947535844e5c0a94df72cf 100644
--- a/src/combustionModels/FSD/FSD.C
+++ b/src/combustionModels/FSD/FSD.C
@@ -260,7 +260,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
 //  Combustion progress variable (c).
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-    List<label> productsIndex(2, -1);
+    List<label> productsIndex(2, label(-1));
     {
         label i = 0;
         forAll (this->singleMixture_.specieProd(), specieI)
diff --git a/src/conversion/meshReader/starcd/STARCDMeshReader.C b/src/conversion/meshReader/starcd/STARCDMeshReader.C
index a7aca36d7fc26199fa813b909f585488d57c455d..09b651efd0497702a65364ec2ba947e25edf7a9a 100644
--- a/src/conversion/meshReader/starcd/STARCDMeshReader.C
+++ b/src/conversion/meshReader/starcd/STARCDMeshReader.C
@@ -640,9 +640,9 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
     label lineLabel, starCellId, cellFaceId, starRegion, configNumber;
     word patchType;
 
-    labelList mapToFoamPatchId(1000, -1);
-    labelList nPatchFaces(1000, 0);
-    labelList origRegion(1000, 0);
+    labelList mapToFoamPatchId(1000, label(-1));
+    labelList nPatchFaces(1000, label(0));
+    labelList origRegion(1000, label(0));
     patchTypes_.setSize(1000);
 
     // this is what we seem to need
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C
index 2e644a43717a97b7b5edebeba1df18993f9bcfc4..01e8c984ec0497a34495ae2e87e1eb0adb7c050b 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C
@@ -862,7 +862,7 @@ void Foam::addPatchCellLayer::setRefinement
         {
             labelList n(mesh_.nPoints(), 0);
             UIndirectList<label>(n, meshPoints) = nPointLayers;
-            syncTools::syncPointList(mesh_, n, maxEqOp<label>(), 0);
+            syncTools::syncPointList(mesh_, n, maxEqOp<label>(), label(0));
 
             // Non-synced
             forAll(meshPoints, i)
@@ -906,7 +906,7 @@ void Foam::addPatchCellLayer::setRefinement
                 mesh_,
                 nFromFace,
                 maxEqOp<label>(),
-                0
+                label(0)
             );
 
             forAll(nPointLayers, i)
@@ -1418,7 +1418,7 @@ void Foam::addPatchCellLayer::setRefinement
             mesh_,
             meshEdgeLayers,
             maxEqOp<label>(),
-            0                   // initial value
+            label(0)            // initial value
         );
 
         forAll(meshEdges, edgeI)
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
index 44b9693d9ed484c408ffca1b581458d8f1d1d3dd..8a772ac888ac8070c1fbec681255f35b26786dc3 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C
@@ -714,7 +714,7 @@ void Foam::combineFaces::setRefinement
         mesh_,
         nPointFaces,
         plusEqOp<label>(),
-        0                   // null value
+        label(0)            // null value
     );
 
     // Remove all unused points. Store position if undoable.
diff --git a/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C b/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C
index 2ed76ea965f92f9cf1aae2a02fb66f5fed3f01a2..206f57d47b205d76ab480d4cd6c6351577db64b6 100644
--- a/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C
+++ b/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C
@@ -94,7 +94,7 @@ void Foam::fvSurfaceMapper::calcAddressing() const
         {
             if (max(addr[faceI]) >= oldNInternal)
             {
-                addr[faceI] = labelList(1, 0);
+                addr[faceI] = labelList(1, label(0));
                 w[faceI] = scalarList(1, 1.0);
             }
         }
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
index bf68fc52378995b2ee0f73af99e8aa866c3efc6f..8f36cc78bcedf20aa4612b3a7892c68f37700979 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
@@ -239,8 +239,14 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
             break;
         }
 
-        label cI =
-            generationCells_[rnd.position(0, generationCells_.size() - 1)];
+        label cI = generationCells_
+        [
+            rnd.position
+            (
+                label(0),
+                generationCells_.size() - 1
+            )
+        ];
 
         // Pick a particle at random from the cell - if there are
         // none, insert one at the cell centre.  Otherwise, split an
@@ -268,7 +274,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
         }
         else
         {
-            label cPI = rnd.position(0, cellOccupancy[cI].size() - 1);
+            label cPI = rnd.position(label(0), cellOccupancy[cI].size() - 1);
 
             // This has to be a reference to the pointer so that it
             // can be set to NULL when the particle is deleted.
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
index c494366f40b3498a8e3e170afe1b329616b883d3..f442f72827f435ebd68e977fea872bf4c5fd6ce2 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
@@ -1255,7 +1255,7 @@ void Foam::autoLayerDriver::getPatchDisplacement
             meshPoints,
             nPointFaces,
             plusEqOp<label>(),
-            0                   // null value
+            label(0)            // null value
         );
 
         forAll(pointNormals, i)
@@ -1954,7 +1954,7 @@ void Foam::autoLayerDriver::setupLayerInfoTruncation
             pp.meshPoints(),
             nPatchPointLayers,
             maxEqOp<label>(),
-            0                   // null value
+            label(0)        // null value
         );
     }
 }
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
index 38ff830954d2717673d94b178c24e77979ac2632..614fd204b3c3b78aaed0aa917b6b08c37d133f81 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
@@ -587,7 +587,7 @@ void Foam::autoLayerDriver::findIsolatedRegions
         pp.meshPoints(),
         isolatedPoint,
         plusEqOp<label>(),
-        0        // null value
+        label(0)        // null value
     );
 
     // stop layer growth on isolated faces
@@ -730,7 +730,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
             meshPoints,
             nPointFaces,
             plusEqOp<label>(),
-            0                   // null value
+            label(0)            // null value
         );
 
         forAll(pointNormals, i)
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
index ee35dbfe4d46d9ab8eb11f93242706e261d0312c..313cd0a0c0505c142e2a5b3253fe030c8adef228 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
@@ -221,7 +221,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
         pp.meshPoints(),
         nBoundary,
         plusEqOp<label>(),  // combine op
-        0                   // null value
+        label(0)            // null value
     );
 
     forAll(avgBoundary, i)
@@ -296,7 +296,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
             mesh,
             globalNum,
             plusEqOp<label>(),  // combine op
-            0                   // null value
+            label(0)            // null value
         );
 
         avgInternal.setSize(meshPoints.size());
diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
index 30816931670d1957bd3e0713521d7f56c514659e..79df04781e80f9e36df0ac7f63b90f96bba18fd2 100644
--- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
+++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
@@ -2002,7 +2002,7 @@ void Foam::meshRefinement::updateMesh
     );
 
     // Update surfaceIndex
-    updateList(map.faceMap(), -1, surfaceIndex_);
+    updateList(map.faceMap(), label(-1), surfaceIndex_);
 
     // Update cached intersection information
     updateIntersections(changedFaces);
@@ -2015,7 +2015,7 @@ void Foam::meshRefinement::updateMesh
         if (userFaceData_[i].first() == KEEPALL)
         {
             // extend list with face-from-face data
-            updateList(map.faceMap(), -1, data);
+            updateList(map.faceMap(), label(-1), data);
         }
         else if (userFaceData_[i].first() == MASTERONLY)
         {
diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
index a9c6badb3b2c17bcaac824bfd3e2dd4110bf1460..c6877bbd8d1b2a6fa74ad631d21e0b6fc0620c50 100644
--- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
+++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
@@ -815,7 +815,7 @@ Foam::List<Foam::labelPair> Foam::meshRefinement::filterDuplicateFaces
         mesh_,
         nBafflesPerEdge,
         plusEqOp<label>(),  // in-place add
-        0                   // initial value
+        label(0)            // initial value
     );
 
 
@@ -2062,7 +2062,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
             mesh_,
             pointBaffle,
             maxEqOp<label>(),
-            -1                  // null value
+            label(-1)           // null value
         );
 
 
diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.C b/src/meshTools/algorithms/MeshWave/FaceCellWave.C
index c0e1e72ee8a64961994609141023d7784eecfbfa..2177382a38b22b15dd45c738dd2042ca4c9831c9 100644
--- a/src/meshTools/algorithms/MeshWave/FaceCellWave.C
+++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.C
@@ -45,7 +45,7 @@ template <class Type, class TrackingData>
 Foam::scalar Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01;
 
 template <class Type, class TrackingData>
-Foam::label Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345;
+int Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345;
 
 namespace Foam
 {
diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.H b/src/meshTools/algorithms/MeshWave/FaceCellWave.H
index 6b58fad24bdffaaccdb9f6c29fdda522eea82e65..cecfc6b5d3ea32fb22935307452fdbdd0cc87f61 100644
--- a/src/meshTools/algorithms/MeshWave/FaceCellWave.H
+++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.H
@@ -240,7 +240,7 @@ class FaceCellWave
 
             //- Used as default trackdata value to satisfy default template
             //  argument.
-            static label dummyTrackData_;
+            static int dummyTrackData_;
 
 
 public:
diff --git a/src/meshTools/algorithms/MeshWave/MeshWave.C b/src/meshTools/algorithms/MeshWave/MeshWave.C
index 5bc898490975d947bc253e3ba47991c5be0413d0..0a6ca3e794a38f64df01913d5a489a2e5911e44c 100644
--- a/src/meshTools/algorithms/MeshWave/MeshWave.C
+++ b/src/meshTools/algorithms/MeshWave/MeshWave.C
@@ -30,7 +30,7 @@ License
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 template <class Type, class TrackingData>
-Foam::label Foam::MeshWave<Type, TrackingData>::dummyTrackData_ = 12345;
+int Foam::MeshWave<Type, TrackingData>::dummyTrackData_ = 12345;
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/meshTools/algorithms/MeshWave/MeshWave.H b/src/meshTools/algorithms/MeshWave/MeshWave.H
index c8085c2b6d3b762fc3f80a01581a4d51a5b55964..21316d8fb6974b22387dc0ab756635002e90374c 100644
--- a/src/meshTools/algorithms/MeshWave/MeshWave.H
+++ b/src/meshTools/algorithms/MeshWave/MeshWave.H
@@ -81,7 +81,7 @@ class MeshWave
 
             //- Used as default trackdata value to satisfy default template
             //  argument.
-            static label dummyTrackData_;
+            static int dummyTrackData_;
 
 public:
 
diff --git a/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.C b/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.C
index fe9af6b5e4e6ab7560eacc9db4ef7ad76788a6f9..4400b0365dd49528b0e4012390f9bcf6685f0787 100644
--- a/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.C
+++ b/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.C
@@ -41,7 +41,7 @@ template <class Type, class TrackingData>
 Foam::scalar Foam::PointEdgeWave<Type, TrackingData>::propagationTol_ = 0.01;
 
 template <class Type, class TrackingData>
-Foam::label Foam::PointEdgeWave<Type, TrackingData>::dummyTrackData_ = 12345;
+int Foam::PointEdgeWave<Type, TrackingData>::dummyTrackData_ = 12345;
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.H b/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.H
index 56befc32fc4cfb8d0b9f376fa4c9bd46fc40ffc9..5c1a32cc879e747415dfe317bffdd5de50d6d6b4 100644
--- a/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.H
+++ b/src/meshTools/algorithms/PointEdgeWave/PointEdgeWave.H
@@ -96,7 +96,7 @@ class PointEdgeWave
 
         //- Used as default trackdata value to satisfy default template
         //  argument.
-        static label dummyTrackData_;
+        static int dummyTrackData_;
 
 
     // Private data
diff --git a/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C
index 74f682d6458d2ca63e6e62af0bd9989fccd22ba6..49d23cc84af87bb7d0e15b3c6bda5aa5065cc606 100644
--- a/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C
+++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C
@@ -58,7 +58,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
     absorptionEmissionModel(dict, mesh),
     coeffsDict_((dict.subDict(typeName + "Coeffs"))),
     speciesNames_(0),
-    specieIndex_(0),
+    specieIndex_(label(0)),
     lookUpTablePtr_(),
     thermo_(mesh.lookupObject<basicThermo>("thermophysicalProperties")),
     EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))),
diff --git a/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C
index 926252ba8f9efa546d3b0763cf8f2358b5918d4f..c2640f402aa7ff36ea5d0dc169ce2d554a64f596 100644
--- a/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C
+++ b/src/thermophysicalModels/radiationModels/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C
@@ -55,7 +55,7 @@ Foam::radiation::wideBandAbsorptionEmission::wideBandAbsorptionEmission
     absorptionEmissionModel(dict, mesh),
     coeffsDict_((dict.subDict(typeName + "Coeffs"))),
     speciesNames_(0),
-    specieIndex_(0),
+    specieIndex_(label(0)),
     lookUpTable_
     (
         fileName(coeffsDict_.lookup("lookUpTableFileName")),