diff --git a/pd/src/pd.tk b/pd/src/pd.tk
index 5ac66af7b2bf3478fd2f9c29d2bf517f88712f8e..891f6537e8e0443f6a13290d039888e1218000a9 100644
--- a/pd/src/pd.tk
+++ b/pd/src/pd.tk
@@ -3300,7 +3300,7 @@ proc pdtk_canvas_new {name width height geometry editable} {
 	bind $name <FocusIn> "menu_fixeditmenu $name"
 	# bind $name <FocusOut> { pdtk_noselect %W }
 	if { $k12_mode == 1 } { pd [concat $name tooltips 1 \;] }
-    after 100 [concat focus $name.c]
+    after idle [concat focus $name.c]
 
 	if { $k12_mode == 1 && $k12_saveas_on_new == 1 } {
 		after 1000 [concat pdtk_k12_saveas_on_new $name]
@@ -4354,7 +4354,6 @@ proc pdtk_canvas_sendkey {name state key iso shift focus serial} {
 
     # autorepeat logic
     if { $iso == "null" } { set iso "" }
-    if { $iso == "spc" } { set iso " " }
 	set autorepeat 1
 	if { $state == 1 } {
 		# press
@@ -4370,8 +4369,11 @@ proc pdtk_canvas_sendkey {name state key iso shift focus serial} {
 	} else {
 		# schedule release
 		set key_serial_release $serial
-		if { $iso == "" } { set iso null }
-		if { $iso == " " } { set iso spc }
+		if {$iso != ""} {
+        	scan $iso %c iso
+    	} else {
+			set iso "null"
+		}
 		after 0 [concat pdtk_canvas_sendkey $name $state $key $iso $shift $focus -1]
 		return
 	}
@@ -4398,7 +4400,11 @@ proc pdtk_canvas_sendkey {name state key iso shift focus serial} {
 		set key 127
     }
     if {$iso != ""} {
-        scan $iso %c key
+    	if {$serial != -1} {
+        	scan $iso %c key
+        } else {
+        	set key $iso
+        }
     }
 
 	if {$key == "Control_L"} {
diff --git a/pd/src/pd_guiprefs.tcl b/pd/src/pd_guiprefs.tcl
index f97d2b45ec7707f263cebf029f4da320608cc51c..6e7955febd97af649554303e4a7dd4c3395872b0 100644
--- a/pd/src/pd_guiprefs.tcl
+++ b/pd/src/pd_guiprefs.tcl
@@ -73,7 +73,7 @@ proc ::pd_guiprefs::update_recentfiles {afile save} {
     set ::recentfiles_list [lreplace $::recentfiles_list $index $index]
     # insert new one in the beginning and crop the list
     set ::recentfiles_list [linsert $::recentfiles_list 0 $afile]
-    set ::recentfiles_list [lrange $::recentfiles_list 0 $::total_recentfiles]
+    set ::recentfiles_list [lrange $::recentfiles_list 0 [expr $::total_recentfiles - 1]]
     #::pd_menus::update_recentfiles_menu .mbar.file $save
     ::pd_guiprefs::write_recentfiles
 }
diff --git a/pd/src/s_main.c b/pd/src/s_main.c
index 4a00c5a912d7f88da06c91c5de9e9b99c4a70efd..621614d342052dce81805e494516a02cb20eeacb 100644
--- a/pd/src/s_main.c
+++ b/pd/src/s_main.c
@@ -160,6 +160,7 @@ int sys_defaultfont;
 
 static void openit(const char *dirname, const char *filename)
 {
+    fprintf(stderr,"openit\n");
     char dirbuf[FILENAME_MAX], *nameptr;
     int fd = open_via_path(dirname, filename, "", dirbuf, &nameptr,
         FILENAME_MAX, 0);
@@ -168,6 +169,8 @@ static void openit(const char *dirname, const char *filename)
         close (fd);
         glob_evalfile(0, gensym(nameptr), gensym(dirbuf));
 		sys_vgui("pdtk_set_current_dir %s\n", filename);
+        //sys_vgui("::pd_menus::update_recentfiles_menu .mbar.file 0\n");
+        sys_vgui("::pd_guiprefs::update_recentfiles %s 1\n", filename);
     }
     else
         error("%s: can't open", filename);
@@ -222,7 +225,7 @@ void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv)
     for  (nl = sys_externlist; nl; nl = nl->nl_next)
         if (!sys_load_lib(0, nl->nl_string))
             post("%s: can't load library", nl->nl_string);
-        /* open patches specifies with "-open" args */
+        /* open patches specified with "-open" args */
     for  (nl = sys_openlist; nl; nl = nl->nl_next)
         openit(cwd, nl->nl_string);
     namelist_free(sys_openlist);