more compression tests
diff --git a/lib/zstd_compress.c b/lib/zstd_compress.c
index 7e81dc1..cfc590a 100644
--- a/lib/zstd_compress.c
+++ b/lib/zstd_compress.c
@@ -1558,7 +1558,7 @@
             const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
             const BYTE* const repMatch = repBase + repIndex;
             if ((repIndex <= dictLimit-4) || (repIndex >= dictLimit))
-            if (MEM_read32(ip+1) == MEM_read32(repMatch))            
+            if (MEM_read32(ip+1) == MEM_read32(repMatch))
             {
                 /* repcode detected we should take it */
                 const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
@@ -1598,7 +1598,7 @@
                 const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
                 const BYTE* const repMatch = repBase + repIndex;
                 if ((repIndex <= dictLimit-4) || (repIndex >= dictLimit))
-                if (MEM_read32(ip) == MEM_read32(repMatch))            
+                if (MEM_read32(ip) == MEM_read32(repMatch))
                 {
                     /* repcode detected */
                     size_t repLength;
@@ -1642,7 +1642,7 @@
                     const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
                     const BYTE* const repMatch = repBase + repIndex;
                     if ((repIndex <= dictLimit-4) || (repIndex >= dictLimit))
-                    if (MEM_read32(ip) == MEM_read32(repMatch))            
+                    if (MEM_read32(ip) == MEM_read32(repMatch))
                     {
                         /* repcode detected */
                         size_t repLength;
@@ -1699,7 +1699,7 @@
             const U32 repIndex = (U32)((ip-base) - offset_2);
             const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
             const BYTE* const repMatch = repBase + repIndex;
-            if (MEM_read32(ip) == MEM_read32(repMatch))            
+            if (MEM_read32(ip) == MEM_read32(repMatch))
             {
                 /* repcode detected we should take it */
                 const BYTE* const repEnd = repIndex < dictLimit ? dictEnd : iend;
@@ -1874,6 +1874,7 @@
         ctxPtr->dictLimit = (U32)(ctxPtr->nextSrc - ctxPtr->base);
         ctxPtr->dictBase = ctxPtr->base;
         ctxPtr->base += ip - ctxPtr->nextSrc;
+        ctxPtr->nextToUpdate = ctxPtr->dictLimit;
     }
 
     /* input-dictionary overlap */