diff --git a/src/nano.c b/src/nano.c
index ad959256fdd1a4209bcfe8c1375b7f6857f7706a..1c7c4dec9c630b5c0eb4eff4fa877fac0a0d4980 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -357,8 +357,8 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
 
 		delete_node(openfile->fileage);
 
-		/* Renumber, starting with the line after the original file_bot. */
-		renumber(file_bot_save->next);
+		/* Renumber, starting at the last line of the original buffer. */
+		renumber(file_bot_save);
 	}
 
 	/* Since the text has now been saved, remove it from the buffer. */