diff --git a/ChangeLog b/ChangeLog
index 9757720dd106deb33a791f6c26fa7589c6164834..b11b591844077c5d3019935f3b63748cda2598de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,8 +49,7 @@ CVS code -
 	  do_page_down(), do_para_end(), do_next_word(), do_prev_word(),
 	  do_up(), do_down(), do_scroll_down(), do_right(), do_mouse(),
 	  do_gotolinecolumn(), do_delete(), begpar(), find_paragraph(),
-	  do_justify(), do_wrap(), remove_magicline(), and
-	  edit_scroll(). (DLR)
+	  do_wrap(), remove_magicline(), and edit_scroll(). (DLR)
 	- Add new -L/--nonewlines command line option, and new
 	  "nonewlines" rcfile option, to control whether nano adds
 	  magiclines to the ends of files.  Changes to read_file(),
diff --git a/src/text.c b/src/text.c
index a409f7ff9dbb6937e0731cee535cfa6ec1041ef3..9a1c2d72d9610ef0480bb8b9f8d80b7a4a516697 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1420,7 +1420,7 @@ void do_justify(bool full_justify)
      * something). */
     last_par_line = openfile->current;
     if (first_par_line != NULL) {
-	if (first_par_line == openfile->fileage)
+	if (first_par_line->prev == NULL)
 	    openfile->fileage = first_par_line;
 	renumber(first_par_line);
     }