Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 31415)
@@ -281,8 +281,12 @@
    */
   public MapillaryAbstractImage next() {
-    synchronized (LOCK) {
-      if (this.getSequence() == null)
+    LOCK.lock();
+    try {
+      if (this.getSequence() == null) {
         return null;
+      }
       return this.getSequence().next(this);
+    } finally {
+      LOCK.unlock();
     }
   }
@@ -295,9 +299,14 @@
    */
   public MapillaryAbstractImage previous() {
-    synchronized (LOCK) {
-      if (this.getSequence() == null)
+    LOCK.lock();
+    try {
+      if (this.getSequence() == null) {
         return null;
+      }
       return this.getSequence().previous(this);
+    } finally {
+      LOCK.unlock();
     }
+
   }
 }
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 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31415)
@@ -57,5 +57,5 @@
    * Destroys the unique instance.
    */
-  public void destroy() {
+  public static void clearInstance() {
     INSTANCE = null;
   }
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 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31415)
@@ -182,7 +182,14 @@
     if (Main.map.mapView.getEditLayer() != null)
       Main.map.mapView.getEditLayer().data.removeDataSetListener(this);
-    MapillaryData.INSTANCE = null;
-    MapillaryLayer.INSTANCE = null;
+    MapillaryData.clearInstance();
+    clearInstance();
     super.destroy();
+  }
+
+  /**
+   * Clears the unique instance of this class.
+   */
+  public static void clearInstance() {
+    INSTANCE = null;
   }
 
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31415)
@@ -75,4 +75,6 @@
         MapillaryLayer.getInstance();
         if (file.isDirectory()) {
+          if (file.listFiles() == null)
+            continue;
           for (int j = 0; j < file.listFiles().length; j++) {
             int k = file.listFiles()[j].getName().lastIndexOf('.');
@@ -87,5 +89,5 @@
               else if (extension.equals("png"))
                 readPNG(file.listFiles()[j]);
-            } catch (ImageReadException | IOException e1) {
+            } catch (ImageReadException | IOException | NullPointerException e1) {
               Main.error(e1);
             }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31415)
@@ -77,4 +77,6 @@
       for (int i = 0; i < chooser.getSelectedFiles().length; i++) {
         File file = chooser.getSelectedFiles()[i];
+        if (file == null)
+          break;
         Main.pref.put("mapillary.start-directory", file.getParent());
         MapillaryLayer.getInstance();
@@ -89,7 +91,5 @@
               if (extension.equals("jpg") || extension.equals("jpeg"))
                 readJPG(file.listFiles()[j]);
-            } catch (ImageReadException e) {
-              Main.error(e);
-            } catch (IOException e) {
+            } catch (ImageReadException | NullPointerException | IOException e) {
               Main.error(e);
             }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryWalkAction.java	(revision 31415)
@@ -51,5 +51,5 @@
     JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE,
         JOptionPane.OK_CANCEL_OPTION);
-    JDialog dlg = pane.createDialog(Main.parent, tr("Export images"));
+    JDialog dlg = pane.createDialog(Main.parent, tr("Walk mode"));
     dlg.setMinimumSize(new Dimension(400, 150));
     dlg.setVisible(true);
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java	(revision 31415)
@@ -57,5 +57,6 @@
               break;
             image = image.next();
-            Utils.downloadPicture((MapillaryImage) image, Utils.PICTURE.THUMBNAIL);
+            Utils.downloadPicture((MapillaryImage) image,
+                Utils.PICTURE.THUMBNAIL);
           }
         }
@@ -96,9 +97,11 @@
           lastImage = MapillaryMainDialog.getInstance().mapillaryImageDisplay
               .getImage();
-          synchronized (lock) {
-            data.selectNext(followSelected);
-          }
+          lock.lock();
+          data.selectNext(followSelected);
+          lock.unlock();
         } catch (InterruptedException e) {
           return;
+        } finally {
+          lock.unlock();
         }
       }
@@ -111,5 +114,12 @@
   @Override
   public void interrupt() {
-    super.interrupt();
+    lock.lock();
+    try {
+      super.interrupt();
+    } catch (Exception e) {
+    } finally {
+      lock.unlock();
+    }
+
   }
 
@@ -123,7 +133,5 @@
       MapillaryAbstractImage newImage) {
     if (newImage != oldImage.next()) {
-      synchronized (lock) {
-        interrupt();
-      }
+      interrupt();
     }
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31415)
@@ -46,6 +46,5 @@
    * @param queryString
    */
-  public MapillarySequenceDownloadThread(ExecutorService ex,
-      String queryString) {
+  public MapillarySequenceDownloadThread(ExecutorService ex, String queryString) {
     this.queryString = queryString;
     this.ex = ex;
@@ -95,24 +94,24 @@
         }
 
+        LOCK.lock();
         MapillaryImage.LOCK.lock();
-        synchronized (LOCK) {
-          for (MapillaryImage img : finalImages) {
-            if (layer.getMapillaryData().getImages().contains(img)) {
-              // The image in finalImages is substituted by the one in the
-              // database, as they represent the same picture.
-              img = (MapillaryImage) layer.getMapillaryData().getImages()
-                  .get(layer.getMapillaryData().getImages().indexOf(img));
-              sequence.add(img);
-              ((MapillaryImage) layer.getMapillaryData().getImages()
-                  .get(layer.getMapillaryData().getImages().indexOf(img)))
-                  .setSequence(sequence);
-              finalImages.set(finalImages.indexOf(img), img);
-            } else {
-              img.setSequence(sequence);
-              sequence.add(img);
-            }
+        for (MapillaryImage img : finalImages) {
+          if (layer.getMapillaryData().getImages().contains(img)) {
+            // The image in finalImages is substituted by the one in the
+            // database, as they represent the same picture.
+            img = (MapillaryImage) layer.getMapillaryData().getImages()
+                .get(layer.getMapillaryData().getImages().indexOf(img));
+            sequence.add(img);
+            ((MapillaryImage) layer.getMapillaryData().getImages()
+                .get(layer.getMapillaryData().getImages().indexOf(img)))
+                .setSequence(sequence);
+            finalImages.set(finalImages.indexOf(img), img);
+          } else {
+            img.setSequence(sequence);
+            sequence.add(img);
           }
         }
         MapillaryImage.LOCK.unlock();
+        LOCK.unlock();
 
         layer.getMapillaryData().addWithoutUpdate(
@@ -122,4 +121,7 @@
       Main.error("Error reading the url " + URL + queryString
           + " might be a Mapillary problem.");
+    } finally {
+      LOCK.unlock();
+      MapillaryImage.LOCK.unlock();
     }
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java	(revision 31415)
@@ -203,5 +203,5 @@
       // Calculates the amount of days since the image was taken
       Long currentTime = currentTime();
-      if (time.getSelectedItem() == TIME_LIST[1]) {
+      if (time.getSelectedItem().equals(TIME_LIST[1])) {
         if (img.getCapturedAt() < currentTime
             - ((Integer) spinner.getValue()).longValue() * 365 * 24 * 60 * 60
@@ -211,5 +211,5 @@
         }
       }
-      if (time.getSelectedItem() == TIME_LIST[2]) {
+      if (time.getSelectedItem().equals(TIME_LIST[2])) {
         if (img.getCapturedAt() < currentTime
             - ((Integer) spinner.getValue()).longValue() * 30 * 24 * 60 * 60
@@ -219,5 +219,5 @@
         }
       }
-      if (time.getSelectedItem() == TIME_LIST[3]) {
+      if (time.getSelectedItem().equals(TIME_LIST[3])) {
         if (img.getCapturedAt() < currentTime
             - ((Integer) spinner.getValue()).longValue() * 60 * 60 * 1000) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryWalkDialog.java	(revision 31415)
@@ -30,5 +30,5 @@
   public MapillaryWalkDialog() {
     JPanel interval = new JPanel();
-    spin = new SpinnerNumberModel(3000, 100, 15000, 100);
+    spin = new SpinnerNumberModel(2000, 500, 10000, 500);
     interval.add(new JLabel("Interval (miliseconds): "));
     interval.add(new JSpinner(spin));
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 31414)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 31415)
@@ -173,5 +173,4 @@
 
     } else if (imageHighlighted && !nothingHighlighted
-        && Main.map.mapView != null
         && Main.map.mapView.getEditLayer().data != null
         && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
