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 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31843)
@@ -56,5 +56,5 @@
 
   @Override
-  public void actionPerformed(ActionEvent e) {
+  public void actionPerformed(ActionEvent event) {
     JFileChooser chooser = new JFileChooser();
     File startDirectory = new File(Main.pref.get("mapillary.start-directory",
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31843)
@@ -60,5 +60,5 @@
   private volatile MapillaryAbstractImage image;
 
-  private final SideButton nextButton = new SideButton(new nextPictureAction());
+  private final SideButton nextButton = new SideButton(new NextPictureAction());
   private final SideButton previousButton = new SideButton(
       new PreviousPictureAction());
@@ -118,5 +118,5 @@
     this.nextButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
         KeyStroke.getKeyStroke("PAGE_DOWN"), "next");
-    this.nextButton.getActionMap().put("next", new nextPictureAction());
+    this.nextButton.getActionMap().put("next", new NextPictureAction());
     this.previousButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
         KeyStroke.getKeyStroke("PAGE_UP"), "previous");
@@ -173,5 +173,5 @@
    * Destroys the unique instance of the class.
    */
-  public static void destroyInstance() {
+  public static synchronized void destroyInstance() {
     instance = null;
   }
@@ -340,9 +340,12 @@
    *
    */
-  private class nextPictureAction extends AbstractAction {
+  private static class NextPictureAction extends AbstractAction {
 
     private static final long serialVersionUID = 3023827221453154340L;
 
-    public nextPictureAction() {
+    /**
+     * Constructs a normal NextPictureAction
+     */
+    public NextPictureAction() {
       putValue(NAME, tr("Next picture"));
       putValue(SHORT_DESCRIPTION, tr("Shows the next picture in the sequence"));
@@ -365,4 +368,7 @@
     private static final long serialVersionUID = -6420511632957956012L;
 
+    /**
+     * Constructs a normal PreviousPictureAction
+     */
     public PreviousPictureAction() {
       putValue(NAME, tr("Previous picture"));
@@ -387,4 +393,7 @@
     private static final long serialVersionUID = -6480229431481386376L;
 
+    /**
+     * Constructs a normal RedAction
+     */
     public RedAction() {
       putValue(NAME, tr("Jump to red"));
@@ -412,4 +421,7 @@
     private static final long serialVersionUID = 6250690644594703314L;
 
+    /**
+     * Constructs a normal BlueAction
+     */
     public BlueAction() {
       putValue(NAME, tr("Jump to blue"));
@@ -433,4 +445,7 @@
     private WalkThread thread;
 
+    /**
+     * Constructs a normal StopAction
+     */
     public StopAction() {
       putValue(NAME, tr("Stop"));
@@ -457,4 +472,7 @@
     private transient WalkThread thread;
 
+    /**
+     * Constructs a normal PlayAction
+     */
     public PlayAction() {
       putValue(NAME, tr("Play"));
@@ -483,4 +501,7 @@
     private WalkThread thread;
 
+    /**
+     * Constructs a normal PauseAction
+     */
     public PauseAction() {
       putValue(NAME, tr("Pause"));
@@ -521,7 +542,8 @@
           return;
         }
-        if (this.mapillaryImageDisplay.getImage() == null) {
-          this.mapillaryImageDisplay.setImage(img);
-        } else if (img.getHeight() > this.mapillaryImageDisplay.getImage().getHeight()) {
+        if (
+            this.mapillaryImageDisplay.getImage() == null
+            || img.getHeight() > this.mapillaryImageDisplay.getImage().getHeight()
+        ) {
           this.mapillaryImageDisplay.setImage(img);
         }
@@ -568,6 +590,5 @@
 
   @Override
-  public void selectedImageChanged(MapillaryAbstractImage oldImage,
-      MapillaryAbstractImage newImage) {
+  public void selectedImageChanged(MapillaryAbstractImage oldImage, MapillaryAbstractImage newImage) {
     setImage(newImage);
     updateImage();
@@ -576,4 +597,5 @@
   @Override
   public void imagesAdded() {
+    // This method is enforced by MapillaryDataListener, but only selectedImageChanged() is needed
   }
 }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryUploadDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryUploadDialog.java	(revision 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryUploadDialog.java	(revision 31843)
@@ -36,5 +36,7 @@
   public MapillaryUploadDialog() {
     setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
-    if (MapillaryUser.getUsername() != null) {
+    if (MapillaryUser.getUsername() == null) {
+      this.add(new JLabel(tr("Go to setting and log in to Mapillary before uploading.")));
+    } else {
       ButtonGroup group = new ButtonGroup();
       this.sequence = new JRadioButton(tr("Upload selected sequence"));
@@ -48,6 +50,4 @@
       this.delete.setSelected(Main.pref.getBoolean("mapillary.delete-after-upload", true));
       add(this.delete);
-    } else {
-      this.add(new JLabel(tr("Go to setting and log in to Mapillary before uploading.")));
     }
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java	(revision 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java	(revision 31843)
@@ -33,8 +33,7 @@
    * Main constructor.
    *
-   * @param ex
-   *          {@link ExecutorService} object that is executing this thread.
-   * @param queryString
-   *          A String containing the parameters for the download.
+   * @param ex {@link ExecutorService} object that is executing this thread.
+   * @param bounds the bounds inside which the image info should be downloaded
+   * @param page the pagenumber of the results that should be retrieved
    */
   public MapillaryImageInfoDownloadThread(ExecutorService ex, Bounds bounds, int page) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThread.java	(revision 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThread.java	(revision 31843)
@@ -38,8 +38,7 @@
    * Main constructor.
    *
-   * @param ex
-   *          {@link ExecutorService} executing this thread.
-   * @param queryString
-   *          String containing the parameters for the download.
+   * @param ex {@link ExecutorService} executing this thread.
+   * @param bounds The bounds inside which the sequences should be downloaded
+   * @param page the pagenumber of the results that should be retrieved
    */
   public MapillarySequenceDownloadThread(ExecutorService ex, Bounds bounds, int page) {
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 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySquareDownloadManagerThread.java	(revision 31843)
@@ -40,6 +40,5 @@
    * Main constructor.
    *
-   * @param queryStringParts
-   *          The query data.
+   * @param bounds the bounds of the area that should be downloaded
    *
    */
@@ -71,6 +70,5 @@
    * Downloads the sequence positions, directions and keys.
    *
-   * @throws InterruptedException
-   *           if the thread is interrupted while running this method.
+   * @throws InterruptedException if the thread is interrupted while running this method.
    */
   private void downloadSequences() throws InterruptedException {
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 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryTrafficSignDownloadThread.java	(revision 31843)
@@ -35,5 +35,5 @@
    * @param ex {@link ExecutorService} object that is executing this thread.
    * @param bounds the bounds in which the traffic signs should be downloaded
-   * @page page the pagenumber of the results page that should be retrieved
+   * @param page the pagenumber of the results page that should be retrieved
    */
   public MapillaryTrafficSignDownloadThread(ExecutorService ex, Bounds bounds, int page) {
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/MapillaryUser.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/MapillaryUser.java	(revision 31842)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/MapillaryUser.java	(revision 31843)
@@ -30,5 +30,5 @@
    * @return The username of the logged in user.
    */
-  public static String getUsername() {
+  public static synchronized String getUsername() {
     if (!isTokenValid) {
       return null;
@@ -51,5 +51,5 @@
    *         strings.
    */
-  public static Map<String, String> getSecrets() {
+  public static synchronized Map<String, String> getSecrets() {
     if (!isTokenValid)
       return null;
