Index: src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 3651)
+++ src/org/openstreetmap/josm/gui/NavigatableComponent.java	(working copy)
@@ -592,6 +592,7 @@
                     // find the nearest selected node
                     if (ntsel == null && nd.isSelected()) {
                         ntsel = nd;
+                        use_selected |= (distSq == minDistSq);  // for unglue nodes feature
                     }
                     // find the nearest newest node that is within about the same
                     // distance as the true nearest node
@@ -603,8 +604,8 @@
 
             // take nearest selected, nearest new or true nearest node to p, in that order
             n = (ntsel != null && use_selected) ? ntsel
-                    : ((ntnew != null) ? ntnew
-                            : nlists.values().iterator().next().get(0));
+                    : (ntnew != null) ? ntnew
+                            : nlists.values().iterator().next().get(0);
         }
 
         return n;
