diff --git a/ChangeLog b/ChangeLog
index f6fbe1ef61f601c90b23b6a72f50963f9e1ea297..dc8c24bf16668e011cfb1eabde7a3deda7b4c516 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -226,9 +226,13 @@ CVS code -
 	- Replace a set_modified() with SET(MODIFIED) to avoid an
 	  unnecessary update, and remove an unneeded clearok(FALSE).
 	  (DLR)
+	- Move the spell checking error handling block down and refactor
+	  it so that we go back into curses mode, reinitialize the
+	  terminal, turn the cursor back on, and turn the mark back on
+	  if necessary before returning the error message. (DLR)
   do_spell()
 	- If the spell-checker printed any error messages onscreen, call
-	  total_redraw() to make sure they're cleared off. (DLR, found
+	  total_refresh() to make sure they're cleared off. (DLR, found
 	  by CHAO Wei-Lun)
   do_output()
 	- Properly allow wrapping when we insert a tab, for consistency.
diff --git a/src/nano.c b/src/nano.c
index f189f87a957ccfce05bb90c7a202f360eb643269..594929c0f744c97a0421a09919c29380be72c129 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2359,6 +2359,14 @@ const char *do_alt_speller(char *tempfile_name)
     /* Wait for alternate speller to complete. */
     wait(&alt_spell_status);
 
+    refresh();
+
+    /* Restore the terminal to its previous state. */
+    terminal_init();
+
+    /* Turn the cursor back on for sure. */
+    curs_set(1);
+
     if (!WIFEXITED(alt_spell_status) ||
 		WEXITSTATUS(alt_spell_status) != 0) {
 	char *altspell_error = NULL;
@@ -2367,16 +2375,15 @@ const char *do_alt_speller(char *tempfile_name)
 
 	altspell_error = charalloc(msglen);
 	snprintf(altspell_error, msglen, invoke_error, alt_speller);
-	return altspell_error;
-    }
 
-    refresh();
-
-    /* Restore the terminal to its previous state. */
-    terminal_init();
+#ifndef NANO_SMALL
+	/* Turn the mark back on if it was on before. */
+	if (old_mark_set)
+	    SET(MARK_ISSET);
+#endif
 
-    /* Turn the cursor back on for sure. */
-    curs_set(1);
+	return altspell_error;
+    }
 
 #ifndef NANO_SMALL
     if (old_mark_set) {
@@ -2509,7 +2516,7 @@ void do_spell(void)
 
     /* If the spell-checker printed any error messages onscreen, make
      * sure that they're cleared off. */
-    total_redraw();
+    total_refresh();
 
     if (spell_msg != NULL)
 	statusbar(_("Spell checking failed: %s: %s"), spell_msg,