Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31950)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31951)
@@ -139,11 +139,13 @@
    */
   public void addMultiSelectedImage(Set<MapillaryAbstractImage> images) {
-    for (MapillaryAbstractImage image : images)
+    for (MapillaryAbstractImage image : images) {
       if (!this.multiSelectedImages.contains(image)) {
-        if (this.getSelectedImage() != null)
+        if (this.getSelectedImage() == null) {
+          this.setSelectedImage(image);
+        } else {
           this.multiSelectedImages.add(image);
-        else
-          this.setSelectedImage(image);
+        }
       }
+    }
     Main.map.mapView.repaint();
   }
@@ -237,7 +239,8 @@
     if (this.listeners.isEmpty())
       return;
-    for (MapillaryDataListener lis : this.listeners)
+    for (MapillaryDataListener lis : this.listeners) {
       if (lis != null)
         lis.imagesAdded();
+    }
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31950)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31951)
@@ -239,6 +239,7 @@
   public void setVisible(boolean visible) {
     super.setVisible(visible);
-    for (MapillaryAbstractImage img : this.data.getImages())
+    for (MapillaryAbstractImage img : this.data.getImages()) {
       img.setVisible(visible);
+    }
     MapillaryFilterDialog.getInstance().refresh();
   }
@@ -347,8 +348,5 @@
         MapillaryImage image = (MapillaryImage) imageAbs;
         ImageIcon icon;
-        if (!this.data.getMultiSelectedImages().contains(image))
-          icon = MapillaryPlugin.MAP_ICON;
-        else
-          icon = MapillaryPlugin.MAP_ICON_SELECTED;
+        icon = this.data.getMultiSelectedImages().contains(image) ? MapillaryPlugin.MAP_ICON_SELECTED : MapillaryPlugin.MAP_ICON;
         draw(g, image, icon, p);
         if (!image.getSigns().isEmpty()) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java	(revision 31950)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java	(revision 31951)
@@ -77,13 +77,11 @@
     if (this.position != -1) {
       boolean equalSets = true;
-      for (MapillaryAbstractImage img : this.commandList.get(this.position).images)
-        if (!command.images.contains(img))
-          equalSets = false;
-      for (MapillaryAbstractImage img : command.images)
-        if (!this.commandList.get(this.position).images.contains(img))
-          equalSets = false;
-      if (equalSets
-          && this.commandList.get(this.position).getClass() == command
-              .getClass()) {
+      for (MapillaryAbstractImage img : this.commandList.get(this.position).images) {
+        equalSets = command.images.contains(img) && equalSets;
+      }
+      for (MapillaryAbstractImage img : command.images) {
+        equalSets = this.commandList.get(this.position).images.contains(img) && equalSets;
+      }
+      if (equalSets && this.commandList.get(this.position).getClass() == command.getClass()) {
         this.commandList.get(this.position).sum(command);
         fireRecordChanged();
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31950)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31951)
@@ -182,5 +182,12 @@
 
   protected static void tooBigErrorDialog() {
-    if (!SwingUtilities.isEventDispatchThread()) {
+    if (SwingUtilities.isEventDispatchThread()) {
+      MapillaryLayer.getInstance().tempSemiautomatic = true;
+      MapillaryPlugin.setMenuEnabled(MapillaryPlugin.getDownloadViewMenu(), true);
+      JOptionPane
+          .showMessageDialog(
+              Main.parent,
+              tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until the layer is restarted."));
+    } else {
       SwingUtilities.invokeLater(new Runnable() {
         @Override
@@ -189,11 +196,4 @@
         }
       });
-    } else {
-      MapillaryLayer.getInstance().tempSemiautomatic = true;
-      MapillaryPlugin.setMenuEnabled(MapillaryPlugin.getDownloadViewMenu(), true);
-      JOptionPane
-          .showMessageDialog(
-              Main.parent,
-              tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until the layer is restarted."));
     }
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySquareDownloadManagerThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySquareDownloadManagerThread.java	(revision 31950)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySquareDownloadManagerThread.java	(revision 31951)
@@ -76,6 +76,7 @@
     while (!this.downloadExecutor.isShutdown()) {
       this.downloadExecutor.execute(new MapillarySequenceDownloadThread(this.downloadExecutor, bounds, page));
-      while (this.downloadExecutor.getQueue().remainingCapacity() == 0)
+      while (this.downloadExecutor.getQueue().remainingCapacity() == 0) {
         Thread.sleep(500);
+      }
       page++;
     }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryTrafficSignDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryTrafficSignDownloadThread.java	(revision 31950)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryTrafficSignDownloadThread.java	(revision 31951)
@@ -66,7 +66,8 @@
             for (int k = 0; k < rects.size(); k++) {
               JsonObject data = rects.getJsonObject(k);
-              for (MapillaryAbstractImage image : MapillaryLayer.getInstance().getData().getImages())
+              for (MapillaryAbstractImage image : MapillaryLayer.getInstance().getData().getImages()) {
                 if (image instanceof MapillaryImage && ((MapillaryImage) image).getKey().equals(key))
                   ((MapillaryImage) image).addSign(data.getString("type"));
+              }
             }
           }
