Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 2134)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 2135)
@@ -4,7 +4,5 @@
 
 import java.awt.Component;
-import java.awt.Container;
 import java.awt.Dimension;
-import java.awt.Frame;
 import java.awt.GridBagLayout;
 import java.awt.Toolkit;
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 2134)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTask.java	(revision 2135)
@@ -24,5 +24,4 @@
  * This is a task for downloading the open changesets of the current user
  * from the OSM server.
-
  *
  */
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 2134)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 2135)
@@ -864,4 +864,8 @@
         }
 
+        /**
+         * Refreshes the list of open changesets
+         * 
+         */
         class RefreshAction extends AbstractAction {
             public RefreshAction() {
@@ -941,5 +945,16 @@
         }
 
+        /**
+         * Updates the current list of open changesets with the changesets
+         * in <code>changesets</code>
+         * 
+         * @param changesets the collection of changesets. If null, removes
+         * all changesets from the current list of changesets
+         */
         public void addOrUpdate(Collection<Changeset> changesets) {
+            if (changesets == null){
+                this.changesets.clear();
+                setSelectedItem(null);
+            }
             for (Changeset cs: changesets) {
                 internalAddOrUpdate(cs);
@@ -948,4 +963,10 @@
             if (getSelectedItem() == null && !this.changesets.isEmpty()) {
                 setSelectedItem(this.changesets.get(0));
+            } else if (getSelectedItem() != null) {
+                if (changesets.contains(getSelectedItem())) {
+                    setSelectedItem(getSelectedItem());
+                } else {
+                    setSelectedItem(this.changesets.get(0));
+                }
             } else {
                 setSelectedItem(null);
Index: trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 2134)
+++ trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 2135)
@@ -355,6 +355,6 @@
             sendRequest(
                     "PUT",
-                    "changeset/" + this.changeset.getId(),
-                    toXml(this.changeset),
+                    "changeset/" + changeset.getId(),
+                    toXml(changeset),
                     monitor
             );
