diff --git a/VersionASM b/VersionASM
index f2826be92f8a5f4b113a5f4cf078c09b32b02fd9..06c4e638d870e4866e411198470f7a15bd53af5d 100644
--- a/VersionASM
+++ b/VersionASM
@@ -12,9 +12,9 @@
 Module_MajorVersion     SETS    "5.82"
 Module_Version          SETA    582
 Module_MinorVersion     SETS    ""
-Module_Date             SETS    "14 Jul 2021"
-Module_ApplicationDate  SETS    "14-Jul-21"
+Module_Date             SETS    "13 Sep 2021"
+Module_ApplicationDate  SETS    "13-Sep-21"
 Module_ComponentName    SETS    "Wimp"
 Module_FullVersion      SETS    "5.82"
-Module_HelpVersion      SETS    "5.82 (14 Jul 2021)"
+Module_HelpVersion      SETS    "5.82 (13 Sep 2021)"
                         END
diff --git a/VersionNum b/VersionNum
index 8663b722120a81891dcee59af59ab10b9613b2f2..47364b8bbfa4c639805aa11857747d74883c5d43 100644
--- a/VersionNum
+++ b/VersionNum
@@ -5,17 +5,17 @@
  */
 #define Module_MajorVersion_CMHG        5.82
 #define Module_MinorVersion_CMHG
-#define Module_Date_CMHG                14 Jul 2021
+#define Module_Date_CMHG                13 Sep 2021
 
 #define Module_MajorVersion             "5.82"
 #define Module_Version                  582
 #define Module_MinorVersion             ""
-#define Module_Date                     "14 Jul 2021"
+#define Module_Date                     "13 Sep 2021"
 
-#define Module_ApplicationDate          "14-Jul-21"
+#define Module_ApplicationDate          "13-Sep-21"
 
 #define Module_ComponentName            "Wimp"
 
 #define Module_FullVersion              "5.82"
-#define Module_HelpVersion              "5.82 (14 Jul 2021)"
+#define Module_HelpVersion              "5.82 (13 Sep 2021)"
 #define Module_LibraryVersionInfo       "5:82"
diff --git a/s/CnPCaret b/s/CnPCaret
index 5ff869e0b24943be4e01f0fa90ac59d885306d7b..8f423b6fc625ab8bc8d63bfc3f7f19b09fa2dbe4 100644
--- a/s/CnPCaret
+++ b/s/CnPCaret
@@ -112,7 +112,8 @@ int_set_caret_position ROUT
         MOVEQ   R2,#0                   ; if we were called with R2='TASK' then
         STREQ   R2,[sp,#(2+1+8)*4]      ; ensure R2=0 on return - taskhandle stacked below r2
 08
-        SavePSR R6                      ; keep V flag for exiting later
+        CLRV                            ; clear V flag as we're not going to report this as an error
+        SavePSR R6
         Push    "R6"
         STR     R0,[sp,#8]              ; preserve error message
         MOV     R0,#-1                  ; carry on as an invalid window handle
@@ -541,6 +542,12 @@ wscp_remove_current_caret ROUT
 ;           r4=flags
 
         Push    "R0-R5,R10,R11,R14"
+        ; ensure we're removing from a valid window
+        Push    "handle"
+        MOV     handle,R0
+        BL      checkhandle
+        Pull    "handle"
+        MOVVS   R0,#nullptr             ; handle was invalid so change it to 'no window'
 
         ; clear redraw block
         MOV     R14,#nullptr