diff --git a/dune/stuff/common/logging.hh b/dune/stuff/common/logging.hh
index 8692b6c4b3fcb346df5420ff4e880f62e98d4123..cff88a392443a2f2fc365bdb7ce49e8bf82ea4eb 100644
--- a/dune/stuff/common/logging.hh
+++ b/dune/stuff/common/logging.hh
@@ -5,15 +5,6 @@
 #ifndef LOGGING_HH_INCLUDED
 #define LOGGING_HH_INCLUDED
 
-#include <fstream>
-#include <ostream>
-#include <sstream>
-#include <ctime>
-#include <iomanip>
-#include <map>
-#include <assert.h>
-
-// dune-common
 #include <dune/common/exceptions.hh>
 
 #include "misc.hh"
@@ -25,6 +16,13 @@
 #include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/path.hpp>
+#include <fstream>
+#include <ostream>
+#include <sstream>
+#include <ctime>
+#include <iomanip>
+#include <map>
+#include <assert.h>
 
 namespace Dune {
 namespace Stuff {
diff --git a/dune/stuff/common/math.hh b/dune/stuff/common/math.hh
index 6bae0fe90833d3b8659dd5acdd1856ce79749fcb..0e4d44752c05baa2893d17e8f966efee670893b7 100644
--- a/dune/stuff/common/math.hh
+++ b/dune/stuff/common/math.hh
@@ -131,14 +131,13 @@ static RangeType1 dyadicProduct(const RangeType2& arg1, const RangeType2& arg2)
   typedef typename RangeType1::RowIterator MatrixRowIteratorType;
   typedef typename RangeType2::ConstIterator ConstVectorIteratorType;
   typedef typename RangeType2::Iterator VectorIteratorType;
-  MatrixRowIteratorType rItEnd   = ret.end();
+  const MatrixRowIteratorType rItEnd = ret.end();
   ConstVectorIteratorType arg1It = arg1.begin();
   for (MatrixRowIteratorType rIt = ret.begin(); rIt != rItEnd; ++rIt) {
-    ConstVectorIteratorType arg2It = arg2.begin();
-    VectorIteratorType vItEnd = rIt->end();
-    for (VectorIteratorType vIt = rIt->begin(); vIt != vItEnd; ++vIt) {
+    ConstVectorIteratorType arg2It  = arg2.begin();
+    const VectorIteratorType vItEnd = rIt->end();
+    for (VectorIteratorType vIt = rIt->begin(); vIt != vItEnd; ++vIt, ++arg2It) {
       *vIt = *arg1It * *arg2It;
-      ++arg2It;
     }
     ++arg1It;
   }
@@ -151,8 +150,6 @@ class MinMaxAvg
 {
 protected:
   typedef MinMaxAvg<ElementType> ThisType;
-  typedef std::vector<ElementType> ElementsVec;
-  typedef typename ElementsVec::const_iterator ElementsVecConstIterator;
 
 public:
   MinMaxAvg()