Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 929)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 930)
@@ -183,16 +183,21 @@
 
 	synchronized public void put(final String key, final String value) {
-		if (value == null)
-			properties.remove(key);
-		else
-			properties.put(key, value);
-		save();
-		firePreferenceChanged(key, value);
+		String oldvalue = properties.get(key);
+		if(value != null && value.length() == 0)
+			value = null;
+		if(!((oldvalue == null && value == null) || (value != null
+		&& oldvalue != null && oldvalue.equals(value))))
+		{
+			if (value == null)
+				properties.remove(key);
+			else
+				properties.put(key, value);
+			save();
+			firePreferenceChanged(key, value);
+		}
 	}
 
 	synchronized public void put(final String key, final boolean value) {
-		properties.put(key, Boolean.toString(value));
-		save();
-		firePreferenceChanged(key, Boolean.toString(value));
+		put(key, Boolean.toString(value));
 	}
 
@@ -210,6 +215,5 @@
 			final PrintWriter out = new PrintWriter(new FileWriter(getPreferencesDir() + "preferences"), false);
 			for (final Entry<String, String> e : properties.entrySet()) {
-				if (!e.getValue().equals(""))
-					out.println(e.getKey() + "=" + e.getValue());
+				out.println(e.getKey() + "=" + e.getValue());
 			}
 			out.close();
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java	(revision 929)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java	(revision 930)
@@ -71,4 +71,5 @@
 		defaults = Main.pref.getDefaults();
 		orig.remove("osm-server.password");
+		defaults.remove("osm-server.password");
 		TreeSet<String> ts = new TreeSet<String>(orig.keySet());
 		for (String s : defaults.keySet())
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 929)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 930)
@@ -53,5 +53,5 @@
 	 * @author imi
 	 */
-	public static class PluginDescription {
+	public static class PluginDescription implements Comparable {
 		// Note: All the following need to be public instance variables of
 		// type String.  (Plugin description XMLs from the server are parsed
@@ -68,4 +68,10 @@
 		}
 		public PluginDescription() {
+		}
+		public int compareTo(Object n) {
+			if(n instanceof PluginDescription)
+				return name.compareToIgnoreCase(((PluginDescription)n).name);
+			else
+				return -1;
 		}
 	}
@@ -328,9 +334,15 @@
 
 		String plugins = "";
-		for (Entry<PluginDescription, Boolean> entry : pluginMap.entrySet())
-			if (entry.getValue())
-				plugins += entry.getKey().name + ",";
-		if (plugins.endsWith(","))
+		Object pd[] = pluginMap.keySet().toArray();
+		Arrays.sort(pd);
+		for(Object d : pd)
+		{
+			if(pluginMap.get(d))
+				plugins += ((PluginDescription)d).name + ",";
+		}
+		if(plugins.endsWith(","))
 			plugins = plugins.substring(0, plugins.length()-1);
+		if(plugins.length() == 0)
+			plugins = null;
 
 		String oldPlugins = Main.pref.get("plugins");
