diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc
index cae09ffdb0e6e42716d8e540328752ce2df17861..5d347cdcd4ada139b2f512fc7f8df29e0d783612 100644
--- a/gcc/cobol/genapi.cc
+++ b/gcc/cobol/genapi.cc
@@ -3290,15 +3290,6 @@ parser_first_statement( int lineno )
 
     sprintf(achentry, "_prog_entry_point_%s", current_function->our_name);
     create_cblc_string_variable(achentry, ach);
-
-    SHOW_PARSE
-      {
-      SHOW_PARSE_INDENT
-      char ach2[512];
-      sprintf(ach2, "setting _cobol_entry_point to \"%s\"", ach);
-      SHOW_PARSE_TEXT(ach2)
-      SHOW_PARSE_END
-      }
     }
   }
 
@@ -3598,6 +3589,11 @@ parser_enter_program( const char *funcname_,
       }
     }
 
+  // Call this after build_main_that_calls_something, because it manipulates
+  // the current line number to DEFAULT_LINE_NUMBER.  We have to manipulate it
+  // back afterward.
+  gg_set_current_line_number(CURRENT_LINE_NUMBER);
+
   if( strcmp(funcname_, "main") == 0 && this_module_has_main )
     {
     // setting 'retval' to 1 let's the caller know that we are being told 
@@ -6404,6 +6400,8 @@ parser_division(cbl_division_t division,
     SHOW_PARSE_END
     }
 
+  gg_set_current_line_number(CURRENT_LINE_NUMBER);
+
   if( division == data_div_e )
     {
     Analyze();