Index: lemon/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h	(revision 2507)
+++ lemon/capacity_scaling.h	(revision 2509)
@@ -27,6 +27,6 @@
 
 #include <vector>
+#include <lemon/graph_adaptor.h>
 #include <lemon/dijkstra.h>
-#include <lemon/graph_adaptor.h>
 
 #define WITH_SCALING
@@ -44,8 +44,10 @@
 
   /// \brief Implementation of the capacity scaling version of the
-  /// successive shortest path algorithm for finding a minimum cost flow.
+  /// successive shortest path algorithm for finding a minimum cost
+  /// flow.
   ///
-  /// \ref lemon::CapacityScaling "CapacityScaling" implements a
-  /// capacity scaling algorithm for finding a minimum cost flow.
+  /// \ref lemon::CapacityScaling "CapacityScaling" implements the
+  /// capacity scaling version of the successive shortest path
+  /// algorithm for finding a minimum cost flow.
   ///
   /// \param Graph The directed graph type the algorithm runs on.
@@ -58,5 +60,5 @@
   /// - Edge capacities and costs should be nonnegative integers.
   ///	However \c CostMap::Value should be signed type.
-  /// - Supply values should be integers.
+  /// - Supply values should be signed integers.
   /// - \c LowerMap::Value must be convertible to
   ///	\c CapacityMap::Value and \c CapacityMap::Value must be
@@ -114,7 +116,4 @@
     public:
 
-      typedef typename MapBase<ResEdge, Cost>::Value Value;
-      typedef typename MapBase<ResEdge, Cost>::Key Key;
-
       ReducedCostMap( const ResGraph &_gr,
 		      const CostMap &_cost,
@@ -122,5 +121,5 @@
 	gr(_gr), cost_map(_cost), pot_map(_pot) {}
 
-      Value operator[](const Key &e) const {
+      Cost operator[](const ResEdge &e) const {
 	return ResGraph::forward(e) ?
 	   cost_map[e] - pot_map[gr.source(e)] + pot_map[gr.target(e)] :
@@ -130,6 +129,6 @@
     }; //class ReducedCostMap
 
-    /// \brief Map adaptor for \ref lemon::Dijkstra "Dijkstra" class to
-    /// update node potentials.
+    /// \brief Map class for the \ref lemon::Dijkstra "Dijkstra"
+    /// algorithm to update node potentials.
     class PotentialUpdateMap : public MapBase<ResNode, Cost>
     {
@@ -142,7 +141,4 @@
     public:
 
-      typedef typename MapBase<ResNode, Cost>::Value Value;
-      typedef typename MapBase<ResNode, Cost>::Key Key;
-
       void potentialMap(PotentialMap &_pot) {
 	pot = &_pot;
@@ -153,5 +149,5 @@
       }
 
-      void set(const Key &n, const Value &v) {
+      void set(const ResNode &n, const Cost &v) {
 	data.push_back(Pair(n, v));
       }
@@ -186,5 +182,5 @@
 
     /// \brief Map adaptor class for filtering edges with at least
-    /// \c delta residual capacity
+    /// \c delta residual capacity.
     class DeltaFilterMap : public MapBase<ResEdge, bool>
     {
@@ -196,11 +192,8 @@
     public:
 
-      typedef typename MapBase<ResEdge, Cost>::Value Value;
-      typedef typename MapBase<ResEdge, Cost>::Key Key;
-
       DeltaFilterMap(const ResGraph &_gr, const Capacity &_delta) :
 	gr(_gr), delta(_delta) {}
 
-      Value operator[](const Key &e) const {
+      bool operator[](const ResEdge &e) const {
 	return gr.rescap(e) >= delta;
       }
@@ -299,7 +292,10 @@
     /// \brief The delta parameter used for capacity scaling.
     Capacity delta;
-    /// \brief Edge filter map.
+    /// \brief Edge filter map for filtering edges with at least
+    /// \c delta residual capacity.
     DeltaFilterMap delta_filter;
-    /// \brief The delta residual graph.
+    /// \brief The delta residual graph (i.e. the subgraph of the
+    /// residual graph consisting of edges with at least \c delta
+    /// residual capacity).
     DeltaResGraph dres_graph;
     /// \brief Map for identifing deficit nodes.
@@ -574,6 +570,6 @@
 	  if (red_cost[e] < 0) {
 	    res_graph.augment(e, r = res_graph.rescap(e));
+	    imbalance[dres_graph.source(e)] -= r;
 	    imbalance[dres_graph.target(e)] += r;
-	    imbalance[dres_graph.source(e)] -= r;
 	  }
 	}
Index: lemon/cycle_canceling.h
===================================================================
--- lemon/cycle_canceling.h	(revision 2457)
+++ lemon/cycle_canceling.h	(revision 2509)
@@ -26,6 +26,6 @@
 
 #include <vector>
+#include <lemon/graph_adaptor.h>
 #include <lemon/circulation.h>
-#include <lemon/graph_adaptor.h>
 
 /// \brief The used cycle-canceling method.
@@ -80,5 +80,5 @@
   /// - Edge capacities and costs should be nonnegative integers.
   ///	However \c CostMap::Value should be signed type.
-  /// - Supply values should be integers.
+  /// - Supply values should be signed integers.
   /// - \c LowerMap::Value must be convertible to
   ///	\c CapacityMap::Value and \c CapacityMap::Value must be
@@ -132,10 +132,7 @@
     public:
 
-      typedef typename MapBase<ResEdge, Cost>::Value Value;
-      typedef typename MapBase<ResEdge, Cost>::Key Key;
-
       ResCostMap(const CostMap &_cost) : cost_map(_cost) {}
 
-      Value operator[](const Key &e) const {
+      Cost operator[](const ResEdge &e) const {
 	return ResGraph::forward(e) ? cost_map[e] : -cost_map[e];
       }
Index: lemon/min_cost_flow.h
===================================================================
--- lemon/min_cost_flow.h	(revision 2474)
+++ lemon/min_cost_flow.h	(revision 2509)
@@ -57,5 +57,5 @@
   /// - Edge capacities and costs should be nonnegative integers.
   ///	However \c CostMap::Value should be signed type.
-  /// - Supply values should be integers.
+  /// - Supply values should be signed integers.
   /// - \c LowerMap::Value must be convertible to
   ///	\c CapacityMap::Value and \c CapacityMap::Value must be
Index: lemon/min_mean_cycle.h
===================================================================
--- lemon/min_mean_cycle.h	(revision 2437)
+++ lemon/min_mean_cycle.h	(revision 2509)
@@ -23,6 +23,7 @@
 ///
 /// \file
-/// \brief Karp algorithm for finding a minimum mean cycle.
-
+/// \brief Karp's algorithm for finding a minimum mean (directed) cycle.
+
+#include <vector>
 #include <lemon/graph_utils.h>
 #include <lemon/topology.h>
@@ -64,5 +65,5 @@
   protected:
 
-    /// \brief Data sturcture for path data.
+    /// \brief Data structure for path data.
     struct PathData
     {
@@ -151,5 +152,5 @@
       // Creating vectors for all nodes
       int n = nodes.size();
-      for (int i = 0; i < nodes.size(); ++i) {
+      for (int i = 0; i < n; ++i) {
 	dmap[nodes[i]].resize(n + 1);
       }
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 2471)
+++ lemon/network_simplex.h	(revision 2509)
@@ -27,6 +27,7 @@
 
 #include <limits>
+#include <lemon/graph_adaptor.h>
+#include <lemon/graph_utils.h>
 #include <lemon/smart_graph.h>
-#include <lemon/graph_utils.h>
 
 /// \brief The pivot rule used in the algorithm.
@@ -86,5 +87,5 @@
   /// - Edge capacities and costs should be nonnegative integers.
   ///	However \c CostMap::Value should be signed type.
-  /// - Supply values should be integers.
+  /// - Supply values should be signed integers.
   /// - \c LowerMap::Value must be convertible to
   ///	\c CapacityMap::Value and \c CapacityMap::Value must be
@@ -149,7 +150,4 @@
     public:
 
-      typedef typename MapBase<Edge, Cost>::Value Value;
-      typedef typename MapBase<Edge, Cost>::Key Key;
-
       ReducedCostMap( const SGraph &_gr,
 		      const SCostMap &_cm,
@@ -157,5 +155,5 @@
 	gr(_gr), cost_map(_cm), pot_map(_pm) {}
 
-      Value operator[](const Key &e) const {
+      Cost operator[](const Edge &e) const {
 	return cost_map[e] - pot_map[gr.source(e)] + pot_map[gr.target(e)];
       }
