diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp
index e364a69ee1..29bdc420df 100644
--- a/eeschema/sch_screen.cpp
+++ b/eeschema/sch_screen.cpp
@@ -1586,12 +1586,12 @@ size_t SCH_SCREEN::getLibSymbolNameMatches( const SCH_SYMBOL& aSymbol,
 
     searchName = aSymbol.GetLibId().GetUniStringLibItemName() + wxS( "_" );
 
-    int tmp;
+    long tmp;
     wxString suffix;
 
     for( auto pair : m_libSymbols )
     {
-        if( pair.first.StartsWith( searchName, &suffix ) && suffix.ToInt( &tmp ) )
+        if( pair.first.StartsWith( searchName, &suffix ) && suffix.ToLong( &tmp ) )
             aMatches.emplace_back( pair.first );
     }
 
diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp
index a534173243..60e39bf7e6 100644
--- a/pcbnew/pcb_edit_frame.cpp
+++ b/pcbnew/pcb_edit_frame.cpp
@@ -4,7 +4,7 @@
  * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
  * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
- * Copyright (C) 2013-2022 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2013-2023 KiCad Developers, see AUTHORS.txt for contributors.
  *
  * This program is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -1099,7 +1099,9 @@ void PCB_EDIT_FRAME::doCloseWindow()
 
     // Remove the auto save file on a normal close of Pcbnew.
     if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
+    {
         wxLogTrace( traceAutoSave, wxT( "The auto save file could not be removed!" ) );
+    }
 
     // Make sure local settings are persisted
     SaveProjectSettings();