diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 19ab9315183fbed85dc87635d05fd362b416b7bb..1d05bb26e9d8a6828dacdfbdb5ca08772da5e8b2 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -4475,6 +4475,8 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit)
                                     x, y1, sel->sel_what,
                                     closest1, closest2, 1, 1);
                             }
+                            else
+                                closest1--;
                         }
                     }
                 }
@@ -4488,7 +4490,7 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit)
                         if (sel->sel_what != y1 && sel->sel_what != y2)
                         {
                             ob1 = pd_checkobject(&sel->sel_what->g_pd);
-                            noutlet1 = obj_ninlets(ob1);
+                            noutlet1 = obj_noutlets(ob1);
                             closest2++;
                             if (closest2 >= ninlet2)
                             {
@@ -4500,6 +4502,8 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit)
                                     x, sel->sel_what, y2,
                                     closest1, closest2, 1, 1);
                             }
+                            else
+                                closest2--;
                         }
                     }
                 }            
diff --git a/pd/src/x_preset.c b/pd/src/x_preset.c
index 8b2ef0ec9aed8bafd8a337f82aaa8f916098e420..d618696a8942e074c1a94002910bf5ebd3bf4a1f 100644
--- a/pd/src/x_preset.c
+++ b/pd/src/x_preset.c
@@ -973,39 +973,45 @@ void preset_hub_save(t_gobj *z, t_binbuf *b)
         phd = x->ph_data;
         while (phd)
         {
-            if(PH_DEBUG) fprintf(stderr,"    saving phd\n");
-            /* designate a node and state whether it is active or disabled
-               (disabled nodes are ones that have presets saved but have been
-               deleted since-- we keep these in the case of undo actions during
-               the session that may go beyond saving something into a file) */
-            binbuf_addv(b, "si", gensym("%node%"), phd->phd_pn_gl_loc_length);
-
-            // gather info about the length of the node's location and store it
-            for (i = 0; i < phd->phd_pn_gl_loc_length; i++)
-            {
-                binbuf_addv(b,"i", (int)phd->phd_pn_gl_loc[i]);
-            }
-
-            // save preset data
-            np = phd->phd_npreset;
-            while (np)
+        	// only save node and preset if it is active, this prevents stale
+        	// data that will be unnecessary since undo is also purged once
+        	// the file is reloaded from the disk
+        	if (phd->phd_node)
             {
-                if (np->np_val.l_n > 0)
-                {
-                    binbuf_addv(b, "si", gensym("%preset%"),
-                        (int)np->np_preset);
-                    for (i = 0; i < np->np_val.l_n; i++)
-                    {
-                        if (np->np_val.l_vec[i].l_a.a_type == A_FLOAT)
-                            binbuf_addv(b, "f",
-                                np->np_val.l_vec[i].l_a.a_w.w_float);
-                        else if (np->np_val.l_vec[i].l_a.a_type == A_SYMBOL)
-                            binbuf_addv(b, "s",
-                                np->np_val.l_vec[i].l_a.a_w.w_symbol);    
-                    }
-                }
-                np = np->np_next;
-            }
+	            if(PH_DEBUG) fprintf(stderr,"    saving phd\n");
+	            /* designate a node and state whether it is active or disabled
+	               (disabled nodes are ones that have presets saved but have been
+	               deleted since-- we keep these in the case of undo actions during
+	               the session that may go beyond saving something into a file) */
+	            binbuf_addv(b, "si", gensym("%node%"), phd->phd_pn_gl_loc_length);
+
+	            // gather info about the length of the node's location and store it
+	            for (i = 0; i < phd->phd_pn_gl_loc_length; i++)
+	            {
+	                binbuf_addv(b,"i", (int)phd->phd_pn_gl_loc[i]);
+	            }
+
+	            // save preset data
+	            np = phd->phd_npreset;
+	            while (np)
+	            {
+	                if (np->np_val.l_n > 0)
+	                {
+	                    binbuf_addv(b, "si", gensym("%preset%"),
+	                        (int)np->np_preset);
+	                    for (i = 0; i < np->np_val.l_n; i++)
+	                    {
+	                        if (np->np_val.l_vec[i].l_a.a_type == A_FLOAT)
+	                            binbuf_addv(b, "f",
+	                                np->np_val.l_vec[i].l_a.a_w.w_float);
+	                        else if (np->np_val.l_vec[i].l_a.a_type == A_SYMBOL)
+	                            binbuf_addv(b, "s",
+	                                np->np_val.l_vec[i].l_a.a_w.w_symbol);    
+	                    }
+	                }
+	                np = np->np_next;
+	            }
+	        }
 
             phd = phd->phd_next;
         }