Index: applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java
===================================================================
--- applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java	(revision 25488)
+++ applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java	(revision 25560)
@@ -316,6 +316,4 @@
 
     private void addNodesToDelete(final Collection<Node> nodesToDelete, final Way w) {
-//        System.out.println("---------------- " + w.getId());
-
         final double angleThreshold = Main.pref.getDouble("simplify-area.angle.threshold", 10);
         final double angleFactor = Main.pref.getDouble("simplify-area.angle.factor", 1.0);
@@ -346,14 +344,16 @@
 
         while (true) {
-//            System.out.println(nodes.size());
             Node prevNode = null;
             LatLon coord1 = null;
             LatLon coord2 = null;
+            int prevIndex = -1;
 
             double minWeight = Double.MAX_VALUE;
             Node bestMatch = null;
 
-            for (int i = 0, len = nodes.size() + (closed ? 2 : 1); i < len; i++) {
-                final int index = i % nodes.size();
+            final int size2 = nodes.size();
+
+            for (int i = 0, len = size2 + (closed ? 2 : 1); i < len; i++) {
+                final int index = i % size2;
 
                 final Node n = nodes.get(index);
@@ -363,17 +363,16 @@
                     final double weight;
 
-                    if (weightList.get(index) == null) {
+                    if (weightList.get(prevIndex) == null) {
                         final double angleWeight = computeConvectAngle(coord1, coord2, coord3) / angleThreshold;
                         final double areaWeight = computeArea(coord1, coord2, coord3) / areaThreshold;
                         final double distanceWeight = Math.abs(crossTrackError(coord1, coord2, coord3)) / distanceThreshold;
 
-                        weight = /*isRequiredNode(w, prevNode, minUse) ||*/
-                        !closed && i == len - 1 || // don't remove last node of the not closed way
-                        angleWeight > 1.0 || areaWeight > 1.0 || distanceWeight > 1.0 ? Double.MAX_VALUE :
-                            angleWeight * angleFactor + areaWeight * areaFactor + distanceWeight * distanceFactor;
-
-                        weightList.set(index, weight);
+                        weight = !closed && i == len - 1 || // don't remove last node of the not closed way
+                                angleWeight > 1.0 || areaWeight > 1.0 || distanceWeight > 1.0 ? Double.MAX_VALUE :
+                                angleWeight * angleFactor + areaWeight * areaFactor + distanceWeight * distanceFactor;
+
+                        weightList.set(prevIndex, weight);
                     } else {
-                        weight = weightList.get(index);
+                        weight = weightList.get(prevIndex);
                     }
 
@@ -387,4 +386,5 @@
                 coord2 = coord3;
                 prevNode = n;
+                prevIndex = index;
             }
 
@@ -395,5 +395,4 @@
             final int index = nodes.indexOf(bestMatch);
 
-            final int size2 = nodes.size();
             weightList.set((index - 1 + size2) % size2, null);
             weightList.set((index + 1 + size2) % size2, null);
