diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index e6e54c32c055aa298ea10c417d861b86d1997af3..c31c13203a5e3119ab2b0222fabbc8debdfb38ce 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -1074,18 +1074,33 @@ int Foam::system(const std::string& command)
 
 void* Foam::dlOpen(const fileName& lib)
 {
+    if (POSIX::debug)
+    {
+        Info<< "dlOpen(const fileName&)"
+            << " : dlopen of " << lib << endl;
+    }
     return ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
 }
 
 
 bool Foam::dlClose(void* handle)
 {
+    if (POSIX::debug)
+    {
+        Info<< "dlClose(void*)"
+            << " : dlclose" << endl;
+    }
     return ::dlclose(handle) == 0;
 }
 
 
 void* Foam::dlSym(void* handle, const std::string& symbol)
 {
+    if (POSIX::debug)
+    {
+        Info<< "dlSym(void*, const std::string&)"
+            << " : dlsym of " << symbol << endl;
+    }
     // clear any old errors - see manpage dlopen
     (void) ::dlerror();
 
@@ -1110,6 +1125,12 @@ bool Foam::dlSymFound(void* handle, const std::string& symbol)
 {
     if (handle && !symbol.empty())
     {
+        if (POSIX::debug)
+        {
+            Info<< "dlSymFound(void*, const std::string&)"
+                << " : dlsym of " << symbol << endl;
+        }
+
         // clear any old errors - see manpage dlopen
         (void) ::dlerror();
 
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
index 7d4f9d0ddf2a195c7855b58272814c23e6a1b23f..92ca5c21bd1a065b27bb0f9e8178527a75d33408 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -97,16 +97,18 @@ struct HashTableCore
         {}
     };
 
+    static const iteratorEnd endIter;
+
     //- iteratorEnd set to beyond the end of any HashTable
-    inline static iteratorEnd cend()
+    inline static const iteratorEnd& cend()
     {
-        return iteratorEnd();
+        return endIter;
     }
 
     //- iteratorEnd set to beyond the end of any HashTable
-    inline static iteratorEnd end()
+    inline static const iteratorEnd& end()
     {
-        return iteratorEnd();
+        return endIter;
     }
 };
 
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C
index edd46a82b30e183b1bda000c3a7a3298f54827df..6c82ecdc45d4ee1e9da56404b70ae15ad0366196 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -37,6 +37,9 @@ const Foam::label Foam::HashTableCore::maxTableSize
     )
 );
 
+const Foam::HashTableCore::iteratorEnd Foam::HashTableCore::endIter;
+
+
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
 
 Foam::label Foam::HashTableCore::canonicalSize(const label size)
diff --git a/src/OpenFOAM/fields/cloud/cloud.C b/src/OpenFOAM/fields/cloud/cloud.C
index 40eb070bcd9759cc5a6e44e04b31a21729f67b6a..27804c1e6b04a51897c170683c317d735ecbc17a 100644
--- a/src/OpenFOAM/fields/cloud/cloud.C
+++ b/src/OpenFOAM/fields/cloud/cloud.C
@@ -25,6 +25,7 @@ License
 
 #include "cloud.H"
 #include "Time.H"
+#include "polyMesh.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C
index ec82fddc88952cddb5e5263047ff95376ec78347..f55543a85ea1801ef789717f1d80e77c8f248720 100644
--- a/src/triSurface/triSurface/triSurface.C
+++ b/src/triSurface/triSurface/triSurface.C
@@ -211,8 +211,6 @@ void Foam::triSurface::checkTriangles(const bool verbose)
     boolList valid(size(), true);
     bool hasInvalid = false;
 
-    const labelListList& fFaces = faceFaces();
-
     forAll(*this, faceI)
     {
         const labelledTri& f = (*this)[faceI];
@@ -236,47 +234,53 @@ void Foam::triSurface::checkTriangles(const bool verbose)
         else
         {
             // duplicate triangle check
-            const labelList& neighbours = fFaces[faceI];
+            const labelList& fEdges = faceEdges()[faceI];
 
             // Check if faceNeighbours use same points as this face.
             // Note: discards normal information - sides of baffle are merged.
-            forAll(neighbours, neighbourI)
-            {
-                if (neighbours[neighbourI] <= faceI)
-                {
-                    // lower numbered faces already checked
-                    continue;
-                }
 
-                const labelledTri& n = (*this)[neighbours[neighbourI]];
+            forAll(fEdges, fp)
+            {
+                const labelList& eFaces = edgeFaces()[fEdges[fp]];
 
-                if
-                (
-                    ((f[0] == n[0]) || (f[0] == n[1]) || (f[0] == n[2]))
-                 && ((f[1] == n[0]) || (f[1] == n[1]) || (f[1] == n[2]))
-                 && ((f[2] == n[0]) || (f[2] == n[1]) || (f[2] == n[2]))
-                )
+                forAll(eFaces, i)
                 {
-                    valid[faceI] = false;
-                    hasInvalid = true;
+                    label neighbour = eFaces[i];
 
-                    if (verbose)
+                    if (neighbour > faceI)
                     {
-                        WarningIn
+                        // lower numbered faces already checked
+                        const labelledTri& n = (*this)[neighbour];
+
+                        if
                         (
-                            "triSurface::checkTriangles(bool verbose)"
-                        )   << "triangles share the same vertices:\n"
-                            << "    face 1 :" << faceI << endl;
-                        printTriangle(Warning, "    ", f, points());
-
-                        Warning
-                            << endl
-                            << "    face 2 :"
-                            << neighbours[neighbourI] << endl;
-                        printTriangle(Warning, "    ", n, points());
+                            ((f[0] == n[0]) || (f[0] == n[1]) || (f[0] == n[2]))
+                         && ((f[1] == n[0]) || (f[1] == n[1]) || (f[1] == n[2]))
+                         && ((f[2] == n[0]) || (f[2] == n[1]) || (f[2] == n[2]))
+                        )
+                        {
+                            valid[faceI] = false;
+                            hasInvalid = true;
+
+                            if (verbose)
+                            {
+                                WarningIn
+                                (
+                                    "triSurface::checkTriangles(bool verbose)"
+                                )   << "triangles share the same vertices:\n"
+                                    << "    face 1 :" << faceI << endl;
+                                printTriangle(Warning, "    ", f, points());
+
+                                Warning
+                                    << endl
+                                    << "    face 2 :"
+                                    << neighbour << endl;
+                                printTriangle(Warning, "    ", n, points());
+                            }
+
+                            break;
+                        }
                     }
-
-                    break;
                 }
             }
         }