diff --git a/eeschema/sim/legacy_workbook.cpp b/eeschema/sim/legacy_workbook.cpp
index 9264647a95..1a4934164c 100644
--- a/eeschema/sim/legacy_workbook.cpp
+++ b/eeschema/sim/legacy_workbook.cpp
@@ -339,7 +339,9 @@ bool SIMULATOR_FRAME_UI::loadLegacyWorkbook( const wxString& aPath )
         if( version >= 5 )
         {
             simTab = dynamic_cast<SIM_TAB*>( m_plotNotebook->GetPage( 0 ) );
-            simTab->SetLastSchTextSimCommand( file.GetNextLine() );
+
+            if( simTab )
+                simTab->SetLastSchTextSimCommand( file.GetNextLine() );
         }
     }
 
diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp
index 2e1e55e984..58b3019b09 100644
--- a/eeschema/sim/simulator_frame_ui.cpp
+++ b/eeschema/sim/simulator_frame_ui.cpp
@@ -1970,16 +1970,16 @@ bool SIMULATOR_FRAME_UI::SaveWorkbook( const wxString& aPath )
 
         int options = simTab->GetSimOptions();
 
-        if( simTab->GetSimOptions() & NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS )
+        if( options & NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS )
             commands_js.push_back( ".kicad adjustpaths" );
 
-        if( simTab->GetSimOptions() & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES )
+        if( options & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES )
             commands_js.push_back( ".save all" );
 
-        if( simTab->GetSimOptions() & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS )
+        if( options & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS )
             commands_js.push_back( ".probe alli" );
 
-        if( simTab->GetSimOptions() & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS )
+        if( options & NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS )
             commands_js.push_back( ".probe allp" );
 
         nlohmann::json tab_js = nlohmann::json(
diff --git a/include/hotkey_store.h b/include/hotkey_store.h
index 23c4d829d8..8b100d14ef 100644
--- a/include/hotkey_store.h
+++ b/include/hotkey_store.h
@@ -38,7 +38,8 @@ struct HOTKEY
     int                       m_EditKeycodeAlt;
 
     HOTKEY() :
-            m_EditKeycode( 0 )
+            m_EditKeycode( 0 ),
+            m_EditKeycodeAlt( 0 )
     { }
 
     HOTKEY( TOOL_ACTION* aAction ) :
diff --git a/plugins/3d/idf/s3d_plugin_idf.cpp b/plugins/3d/idf/s3d_plugin_idf.cpp
index 0566b55717..6cec27a838 100644
--- a/plugins/3d/idf/s3d_plugin_idf.cpp
+++ b/plugins/3d/idf/s3d_plugin_idf.cpp
@@ -24,8 +24,6 @@
 
 // Note: the board's bottom side is at Z = 0
 
-#include <iostream>
-#include <sstream>
 #include <cmath>
 #include <string>
 #include <map>