diff --git a/ANSI.c b/ANSI.c
index cba707d..cd5473d 100644
--- a/ANSI.c
+++ b/ANSI.c
@@ -151,6 +151,9 @@
     join multibyte characters split across separate writes;
     remove wcstok, avoiding potential interference with the host;
     similarly, use a private heap instead of malloc.
+
+  v1.80, 26 October, 2017:
+    fix unloading.
 */
 
 #include "ansicon.h"
@@ -1598,19 +1601,32 @@ BOOL HookAPIAllMod( PHookFn Hooks, BOOL restore, BOOL indent )
     if (me.hModule == hDllInstance || me.hModule == hKernel)
       continue;
 
-    // Don't scan what we've already scanned.
-    if (*(PDWORD)((PBYTE)me.hModule + 36) == 'ISNA')    // e_oemid, e_oeminfo
+    if (!restore)
     {
-      if (log_level & 16)
-	DEBUGSTR( 2, "%s%s %S", sp, zSkipping, me.szModule );
-      continue;
+      // Don't scan what we've already scanned.
+      if (*(PDWORD)((PBYTE)me.hModule + 36) == 'ISNA')    // e_oemid, e_oeminfo
+      {
+	if (log_level & 16)
+	  DEBUGSTR( 2, "%s%s %S", sp, zSkipping, me.szModule );
+	continue;
+      }
+      // It's possible for the PE header to be inside the DOS header.
+      if (*(PDWORD)((PBYTE)me.hModule + 0x3C) >= 0x40)
+      {
+	VirtualProtect( (PBYTE)me.hModule + 36, 4, PAGE_READWRITE, &pr );
+	*(PDWORD)((PBYTE)me.hModule + 36) = 'ISNA';
+	VirtualProtect( (PBYTE)me.hModule + 36, 4, pr, &pr );
+      }
     }
-    // It's possible for the PE header to be inside the DOS header.
-    if (*(PDWORD)((PBYTE)me.hModule + 0x3C) >= 0x40)
+    else
     {
-      VirtualProtect( (PBYTE)me.hModule + 36, 4, PAGE_READWRITE, &pr );
-      *(PDWORD)((PBYTE)me.hModule + 36) = 'ISNA';
-      VirtualProtect( (PBYTE)me.hModule + 36, 4, pr, &pr );
+      if (*(PDWORD)((PBYTE)me.hModule + 36) != 'ISNA' &&
+	  *(PDWORD)((PBYTE)me.hModule + 0x3C) >= 0x40)
+      {
+	if (log_level & 16)
+	  DEBUGSTR( 2, "%s%s %S", sp, zSkipping, me.szModule );
+	continue;
+      }
     }
     if (search_env( L"ANSICON_EXC", me.szModule ))
     {
diff --git a/ansicon.c b/ansicon.c
index 1cff464..5af2592 100644
--- a/ansicon.c
+++ b/ansicon.c
@@ -87,7 +87,7 @@
 	 add error codes to some message.
 */
 
-#define PDATE L"24 December, 2015"
+#define PDATE L"26 October, 2017"
 
 #include "ansicon.h"
 #include "version.h"
diff --git a/version.h b/version.h
index 4d8705c..82da648 100644
--- a/version.h
+++ b/version.h
@@ -2,11 +2,11 @@
   version.h - Version defines.
 */
 
-#define PVERS	L"1.72"         // wide string
-#define PVERSA	 "1.72"         // ANSI string (windres 2.16.91 didn't like L)
-#define PVERE	L"172"          // wide environment string
-#define PVEREA	 "172"          // ANSI environment string
-#define PVERB	1,7,2,0 	// binary (resource)
+#define PVERS	L"1.80"         // wide string
+#define PVERSA	 "1.80"         // ANSI string (windres 2.16.91 didn't like L)
+#define PVERE	L"180"          // wide environment string
+#define PVEREA	 "180"          // ANSI environment string
+#define PVERB	1,8,0,0 	// binary (resource)
 
 #ifdef _WIN64
 # define BITS L"64"