diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C
index 27cc47f823f28099c7b0f30f0319d1893449ab73..18109761a5bb90af4308933b4a1423c44b7dcfc8 100644
--- a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C
+++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C
@@ -466,8 +466,8 @@ int main(int argc, char *argv[])
     labelListList pointPoints;
     autoPtr<mapDistribute> meshDistributor = buildMap(mesh, pointPoints);
 
-    triadField alignments = buildAlignmentField(mesh);
-    pointField points = buildPointField(mesh);
+    triadField alignments(buildAlignmentField(mesh));
+    pointField points(buildPointField(mesh));
 
     mesh.printInfo(Info);
 
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
index 124f4b39dc1558721662de315c51d50e33584256..fcc5d8c2ba8926842f6d5a5d205334cab3e7f992 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H
@@ -168,7 +168,8 @@ public:
         );
 
         //- Inserts points into the triangulation if the point is within
-        //  the circumsphere of another cell
+        //  the circumsphere of another cell. Returns HashSet of failed
+        //  point insertions
         template<class PointIterator>
         labelPairHashSet rangeInsertReferredWithInfo
         (
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C
index a6b47f4ab0874630518bdb6b23268868a6b1150e..7238f270bb365994f12c0c5a32509af0e8e6010b 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C
@@ -585,7 +585,7 @@ Foam::label Foam::cellShapeControl::refineMesh
     const autoPtr<backgroundMeshDecomposition>& decomposition
 )
 {
-    const pointField cellCentres = shapeControlMesh_.cellCentres();
+    const pointField cellCentres(shapeControlMesh_.cellCentres());
 
     Info<< "    Created cell centres" << endl;
 
@@ -682,7 +682,7 @@ Foam::label Foam::cellShapeControl::refineMesh
                 )
             );
             verts.last().targetCellSize() = lastCellSize;
-            verts.last().alignment() = tensor::I;
+            verts.last().alignment() = triad::unset;
         }
     }
 
@@ -704,8 +704,8 @@ void Foam::cellShapeControl::smoothMesh()
         pointPoints
     );
 
-    triadField alignments = buildAlignmentField(shapeControlMesh_);
-    pointField points = buildPointField(shapeControlMesh_);
+    triadField alignments(buildAlignmentField(shapeControlMesh_));
+    pointField points(buildPointField(shapeControlMesh_));
     // Setup the sizes and alignments on each point
     triadField fixedAlignments(shapeControlMesh_.vertexCount(), triad::unset);
 
@@ -721,12 +721,7 @@ void Foam::cellShapeControl::smoothMesh()
         {
             const tensor& alignment = vit->alignment();
 
-            fixedAlignments[vit->index()] = triad
-            (
-                alignment.x(),
-                alignment.y(),
-                alignment.z()
-            );
+            fixedAlignments[vit->index()] = alignment;
         }
     }
 
@@ -881,12 +876,7 @@ void Foam::cellShapeControl::smoothMesh()
     {
         if (vit->real())
         {
-            vit->alignment() = tensor
-            (
-                alignments[vit->index()].x(),
-                alignments[vit->index()].y(),
-                alignments[vit->index()].z()
-            );
+            vit->alignment() = alignments[vit->index()];
         }
     }
 
@@ -911,9 +901,7 @@ void Foam::cellShapeControl::smoothMesh()
     {
         if (vit->referred())
         {
-            const triad& t = alignments[referredPoints[referredI++]];
-
-            vit->alignment() = tensor(t.x(), t.y(), t.z());
+            vit->alignment() = alignments[referredPoints[referredI++]];
         }
     }
 }
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C
index bdcbf5a8857efa543ed0bbd0521e284a58bd1d31..ae57bbb087bb74a2f37f0efb6a4d52b6f4daaeec 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C
@@ -684,7 +684,7 @@ void Foam::cellShapeControlMesh::insertBoundingPoints(const boundBox& bb)
     boundBox bbInflate = bb;
     bbInflate.inflate(10);
 
-    pointField pts = bbInflate.points();
+    pointField pts(bbInflate.points());
 
     forAll(pts, pI)
     {
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C
index e8f09cf5f111d088cfb60838c3e53d7432147ca7..4a73b4a7c51cc78e1607d3ffd42a2058f2710729 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C
@@ -263,8 +263,6 @@ Foam::triSurfaceScalarField Foam::automatic::load()
 
     surfaceCellSize.write();
 
-    debug = 1;
-
     if (debug)
     {
         faceList faces(surface_.size());
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
index d2aa6a802719178a934a387ab860f067d7458414..5eb2c01f5fa27436f97e273282b9508fc9033b09 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
@@ -212,9 +212,8 @@ void Foam::conformalVoronoiMesh::checkDuals()
 
     typedef CGAL::Exact_predicates_exact_constructions_kernel       EK2;
     typedef CGAL::Regular_triangulation_euclidean_traits_3<EK2>     EK;
-    typedef CGAL::Cartesian_converter<typename baseK::Kernel, EK2>  To_exact;
-    typedef CGAL::Cartesian_converter<EK2, typename baseK::Kernel>
-        Back_from_exact;
+    typedef CGAL::Cartesian_converter<baseK::Kernel, EK2>  To_exact;
+    typedef CGAL::Cartesian_converter<EK2, baseK::Kernel>  Back_from_exact;
 
 //    PackedBoolList bPoints(number_of_finite_cells());
 
@@ -392,13 +391,13 @@ void Foam::conformalVoronoiMesh::checkDuals()
                         CGAL::Gmpq z(CGAL::to_double(masterPoint.z()));
 
                         std::cout<< "master = " << x << " " << y << " " << z
-                                 << endl;
+                                 << std::endl;
 
                         CGAL::Gmpq xs(CGAL::to_double(closestPoint.x()));
                         CGAL::Gmpq ys(CGAL::to_double(closestPoint.y()));
                         CGAL::Gmpq zs(CGAL::to_double(closestPoint.z()));
                         std::cout<< "slave  = " << xs << " " << ys << " " << zs
-                                 << endl;
+                                 << std::endl;
                     }
                 }
                 else
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H
index 02d37c1b05caa7cd82d4a3d3317cfd5c25121a66..ea9e4db6d4630a70e75bc173a1a4daf5674eb6d7 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexI.H
@@ -142,7 +142,7 @@ inline int CGAL::indexedVertex<Gt, Vb>::index() const
 
 
 template<class Gt, class Vb>
-inline typename CGAL::indexedVertex<Gt, Vb>::vertexType&
+inline Foam::indexedVertexEnum::vertexType&
 CGAL::indexedVertex<Gt, Vb>::type()
 {
     return type_;
@@ -150,7 +150,7 @@ CGAL::indexedVertex<Gt, Vb>::type()
 
 
 template<class Gt, class Vb>
-inline typename CGAL::indexedVertex<Gt, Vb>::vertexType
+inline Foam::indexedVertexEnum::vertexType
 CGAL::indexedVertex<Gt, Vb>::type() const
 {
     return type_;
diff --git a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H
index d9e5736ca24b7070200f9da17b257669816d215f..cbf6466d2646faa0df17c1ee7739b071874b79e3 100644
--- a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H
+++ b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -36,7 +36,6 @@ SourceFiles
 #define symmTensor_H
 
 #include "SymmTensor.H"
-#include "vector.H"
 #include "contiguous.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/Tensor/Tensor.H b/src/OpenFOAM/primitives/Tensor/Tensor.H
index 8b3c1d9a9d87ecc5a104d2d566454ebce491fc28..94b567d532b08ce10c40afbd255ac0b47400735e 100644
--- a/src/OpenFOAM/primitives/Tensor/Tensor.H
+++ b/src/OpenFOAM/primitives/Tensor/Tensor.H
@@ -103,6 +103,9 @@ public:
         //- Construct given SymmTensor
         inline Tensor(const SymmTensor<Cmpt>&);
 
+        //- Construct given triad
+        inline Tensor(const Vector<Vector<Cmpt> >&);
+
         //- Construct given the three vector components
         inline Tensor
         (
@@ -165,6 +168,9 @@ public:
 
         //- Assign to a SymmTensor
         inline void operator=(const SymmTensor<Cmpt>&);
+
+        //- Assign to a triad
+        inline void operator=(const Vector<Vector<Cmpt> >&);
 };
 
 
diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H
index 237bb6ceb393057cfd9657252d55a08f6facd25b..416507e6b758ccee0e9fdb44a8584fb37bd8c76d 100644
--- a/src/OpenFOAM/primitives/Tensor/TensorI.H
+++ b/src/OpenFOAM/primitives/Tensor/TensorI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -66,6 +66,24 @@ inline Tensor<Cmpt>::Tensor(const SymmTensor<Cmpt>& st)
 }
 
 
+//- Construct given triad
+template <class Cmpt>
+inline Tensor<Cmpt>::Tensor(const Vector<Vector<Cmpt> >& tr)
+{
+    this->v_[XX] = tr.x().x();
+    this->v_[XY] = tr.x().y();
+    this->v_[XZ] = tr.x().z();
+
+    this->v_[YX] = tr.y().x();
+    this->v_[YY] = tr.y().y();
+    this->v_[YZ] = tr.y().z();
+
+    this->v_[ZX] = tr.z().x();
+    this->v_[ZY] = tr.z().y();
+    this->v_[ZZ] = tr.z().z();
+}
+
+
 //- Construct given the three vector components
 template <class Cmpt>
 inline Tensor<Cmpt>::Tensor
@@ -272,6 +290,23 @@ inline void Tensor<Cmpt>::operator=(const SymmTensor<Cmpt>& st)
 }
 
 
+template <class Cmpt>
+inline void Tensor<Cmpt>::operator=(const Vector<Vector<Cmpt> >& tr)
+{
+    this->v_[XX] = tr.x().x();
+    this->v_[XY] = tr.x().y();
+    this->v_[XZ] = tr.x().z();
+
+    this->v_[YX] = tr.y().x();
+    this->v_[YY] = tr.y().y();
+    this->v_[YZ] = tr.y().z();
+
+    this->v_[ZX] = tr.z().x();
+    this->v_[ZY] = tr.z().y();
+    this->v_[ZZ] = tr.z().z();
+}
+
+
 // * * * * * * * * * * * * * * * Global Operators  * * * * * * * * * * * * * //
 
 //- Hodge Dual operator (tensor -> vector)
diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C
index 80218dc77693978836f7b1ebc918dc0ea41eee4e..2382e2c3219c65880c20da4619090aa8d9179266 100644
--- a/src/OpenFOAM/primitives/triad/triad.C
+++ b/src/OpenFOAM/primitives/triad/triad.C
@@ -25,7 +25,6 @@ License
 
 #include "triad.H"
 #include "transform.H"
-#include "tensor.H"
 #include "quaternion.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@@ -63,6 +62,14 @@ Foam::triad::triad(const quaternion& q)
 }
 
 
+Foam::triad::triad(const tensor& t)
+{
+    x() = t.x();
+    y() = t.y();
+    z() = t.z();
+}
+
+
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 void Foam::triad::orthogonalize()
@@ -331,6 +338,16 @@ Foam::triad::operator quaternion() const
 }
 
 
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
+void Foam::triad::operator=(const tensor& t)
+{
+    x() = t.x();
+    y() = t.y();
+    z() = t.z();
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/primitives/triad/triad.H b/src/OpenFOAM/primitives/triad/triad.H
index 624116602e1330f71eb5674e8a53621c95495632..3915faff5047c2ba1966b54d3c499e4216fe19f1 100644
--- a/src/OpenFOAM/primitives/triad/triad.H
+++ b/src/OpenFOAM/primitives/triad/triad.H
@@ -40,6 +40,7 @@ SourceFiles
 #define triad_H
 
 #include "vector.H"
+#include "tensor.H"
 #include "contiguous.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -58,7 +59,6 @@ Ostream& operator<<(Ostream&, const triad&);
 
 class quaternion;
 
-
 /*---------------------------------------------------------------------------*\
                            Class triad Declaration
 \*---------------------------------------------------------------------------*/
@@ -87,6 +87,9 @@ public:
         //- Construct from a quaternion
         triad(const quaternion& q);
 
+        //- Construct from a tensor
+        triad(const tensor& t);
+
         //- Construct from Istream
         inline triad(Istream&);
 
@@ -135,6 +138,8 @@ public:
 
         inline void operator=(const Vector<vector>&);
 
+        void operator=(const tensor& t);
+
         //- Add the triad t2 to this triad
         //  without normalizing or orthogonalizing
         void operator+=(const triad& t2);
diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C
index 0aebc63a0da4ed892686d530e655c3ef859ee0e5..fb93ad0d4219126508c7cbe2b51e3a90f3544bb0 100644
--- a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C
+++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C
@@ -496,7 +496,6 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
     faceFilterFactor_.resize(mesh_.nFaces(), initialFaceLengthFactor_);
 
     // Maintain the number of times a point has been part of a bad face
-    //
     labelList pointErrorCount(mesh_.nPoints(), 0);
 
     // Main loop
diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
index 7b1871cd9a6d92c955b31f42ebf714a2d1e950a6..b48d0ee60e1684a09f93dded5c8da4be8acc3ba2 100644
--- a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
+++ b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
@@ -564,8 +564,6 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeaturePoints
     List<pointIndexHit>& info
 ) const
 {
-    DynamicList<pointIndexHit> dynPointHit;
-
     // Pick up all the feature points that intersect the search sphere
     labelList elems = pointTree().findSphere
     (
@@ -573,6 +571,8 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeaturePoints
         searchRadiusSqr
     );
 
+    DynamicList<pointIndexHit> dynPointHit(elems.size());
+
     forAll(elems, elemI)
     {
         label index = elems[elemI];
@@ -609,7 +609,7 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeatureEdges
     sliceStarts[3] = openStart_;
     sliceStarts[4] = multipleStart_;
 
-    DynamicList<pointIndexHit> dynEdgeHit;
+    DynamicList<pointIndexHit> dynEdgeHit(edgeTrees.size()*3);
 
     // Loop over all the feature edge types
     forAll(edgeTrees, i)