diff --git a/ChangeLog b/ChangeLog
index 299a475f1fa6eb37e517fe1a613def2614c885de..8de5249ed87bcb4c417f29f2d83c9537c77cb053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,10 @@ CVS code -
   get_next_filename()
 	- Use an unsigned long instead of an int for the number
 	  prepended to the filename. (DLR)
+  do_insertfile()
+	- Set i to 0 when we get a filename via the file browser, so
+	  that it's read in properly when we exit the file browser.
+	  (DLR)
   write_file()
 	- Since lineswritten is a size_t, print its value as an unsigned
 	  long instead of an unsigned int. (DLR)
diff --git a/src/files.c b/src/files.c
index 289264df44de51ded3e8533aadb8d17af6013fda..2a42664e13b9d64fb27722656d60aeea28108422 100644
--- a/src/files.c
+++ b/src/files.c
@@ -569,7 +569,8 @@ void do_insertfile(
 
 	    ans = mallocstrcpy(ans, answer);
 
-#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
+#ifndef NANO_SMALL
+#ifdef ENABLE_MULTIBUFFER
 	    if (i == TOGGLE_MULTIBUFFER_KEY) {
 		/* Don't allow toggling if we're in view mode. */
 		if (!ISSET(VIEW_MODE))
@@ -578,6 +579,12 @@ void do_insertfile(
 	    }
 #endif
 
+	    if (i == NANO_TOOTHERINSERT_KEY) {
+		execute = !execute;
+		continue;
+	    }
+#endif /* !NANO_SMALL */
+
 #ifndef DISABLE_BROWSER
 	    if (i == NANO_TOFILES_KEY) {
 		char *tmp = do_browse_from(answer);
@@ -588,19 +595,13 @@ void do_insertfile(
 		free(answer);
 		answer = tmp;
 
-		/* We have a file now.  Get out of the statusbar prompt
-		 * cleanly. */
+		/* We have a file now.  Indicate this and get out of the
+		 * statusbar prompt cleanly. */
+		i = 0;
 		statusq_abort();
 	    }
 #endif
 
-#ifndef NANO_SMALL
-	    if (i == NANO_TOOTHERINSERT_KEY) {
-		execute = !execute;
-		continue;
-	    }
-#endif
-
 	    /* If we don't have a file yet, go back to the statusbar
 	     * prompt. */
 	    if (i != 0