diff -u -r 31.0/Scripts/BepInEx/plugins/Console/Lib/posesavestate.py 31.1/Scripts/BepInEx/plugins/Console/Lib/posesavestate.py
--- 31.0/Scripts/BepInEx/plugins/Console/Lib/posesavestate.py	Wed Apr 28 20:17:35 2021
+++ 31.1/Scripts/BepInEx/plugins/Console/Lib/posesavestate.py	Wed Apr 28 20:17:36 2021
@@ -755,6 +755,7 @@
         PoseConsoleUIData.__init__(self, "sss/xxpelib/")
 
     def savePoseData(self, name, tags, group, offset_flag = False, rep_loaded = False):
+        global _pc
         char = get_selected_objs(_pc.game)
         if not char == None:
             char = char[0]
@@ -762,7 +763,6 @@
             # trying to find necessary clip
             if plXxpe.isDetected:
                 blshapesxml = plXxpe.GetBlendShapesXML(char.objctrl)
-                global _pc
                 resFace = _pc.ffaces.savePoseData(name,tags,group,offset_flag,rep_loaded)
 
 
@@ -791,7 +791,6 @@
 
             if plXxpe.isDetected:
                 #plXxpe.SetBlendShapesXML(char.objctrl, state)
-                global _pc
                 resFace = _pc.ffaces.applyState(state['face'])
 
                 plXxpe.SetBlendShapesXML(char.objctrl, state['xxpexml'])
diff -u -r 31.0/Unity.Console/Console.ini 31.1/Unity.Console/Console.ini
--- 31.0/Unity.Console/Console.ini	Mon Sep 13 16:58:08 2021
+++ 31.1/Unity.Console/Console.ini	Mon Sep 13 16:58:08 2021
@@ -20,7 +20,7 @@
 ShowKeyAlt=0
 
 ; Show the console at startup
-ShowAtStartup=1
+ShowAtStartup=0
 
 ; Set to 1 if you wish to have autoload scripts started automatically
 StartHidden=1
diff -u -r 31.0/Unity.Console/Program.cs 31.1/Unity.Console/Program.cs
--- 31.0/Unity.Console/Program.cs	Sun Jul 11 16:53:21 2021
+++ 31.1/Unity.Console/Program.cs	Sun Jul 11 16:53:21 2021
@@ -51,7 +51,11 @@
 
         public static void Initialize(bool startHidden, bool focus)
         {
+#if !FIX
             Run(!startHidden, focus, TimeSpan.FromMilliseconds(_startdelay));
+#else
+            Run(true, startHidden, focus, TimeSpan.FromMilliseconds(_startdelay));
+#endif
         }
 
         public static void Close()
@@ -69,7 +73,11 @@
 
         public static void Main()
         {
+#if !FIX
             Run(false, false, TimeSpan.Zero);
+#else
+            Run(false, false, false, TimeSpan.Zero);
+#endif
         }
 
         public static bool FindAssembly(string name, out Assembly result)
@@ -95,7 +103,11 @@
             return false;
         }
 
+#if !FIX
         public class UnityPythonCommandLine : PythonCommandLine
+#else
+        public class UnityPythonCommandLine : CommandLine
+#endif
         {
             protected override int RunInteractive()
             {
@@ -108,7 +120,11 @@
             }
         }
 
+#if !FIX
         public static void Run(bool allocConsole, bool focusWindow, TimeSpan waitTime)
+#else
+        public static void Run(bool allocConsole, bool startHidden, bool focusWindow, TimeSpan waitTime)
+#endif
         {
             if (!_enable)
             {
@@ -134,6 +150,12 @@
                     bool restoreWindow = false;
 
                     AllocConsole();
+#if FIX
+                    if (startHidden)
+                    {
+                        ShowWindowAsync(GetConsoleWindow(), SW_HIDE);
+                    }
+#endif
                     SetConsoleTitle("Unity Console");
                     SetConsoleCP(65001);
                     SetConsoleOutputCP(65001);
@@ -397,7 +419,11 @@
             int MAX_BUFFER = 32767;
             byte[] bytes = new byte[MAX_BUFFER];
             int nbytes = GetPrivateProfileSection(appName, bytes, MAX_BUFFER, fileName);
+#if !FIX
             if (nbytes == MAX_BUFFER || nbytes == 0)
+#else
+            if ((uint)nbytes >= MAX_BUFFER - 2 || nbytes == 0)
+#endif
             {
                 return false;
             }
@@ -535,6 +561,9 @@
         [DllImport("user32.dll")]
         private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
 
+#if FIX
+        private const int SW_HIDE = 0;
+#endif
         private const int SW_RESTORE = 9;
         private const int SW_SHOW = 5;
     }
