diff --git a/docs/changes.txt b/docs/changes.txt
index 48ec6401d..8e8a12e28 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -40,6 +40,7 @@
 - Fixed use of option --keyspace in combination with -m 2500 (WPA)
 - Fixed rule 'O' (RULE_OP_MANGLE_OMIT) in host mode in case the offset + length parameter equals the length of the input word
 - Fixed duplicate detection for WPA handshakes with the same ESSID
+- Fixed clEnqueueNDRangeKernel(): CL_UNKNOWN_ERROR caused by an invalid work-item count during weak-hash-check
 
 ##
 ## Technical
diff --git a/include/common.h b/include/common.h
index f8881fff2..44d90a902 100644
--- a/include/common.h
+++ b/include/common.h
@@ -34,6 +34,7 @@
 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
 
 #define CEIL(a) ((a - (int) (a)) > 0 ? a + 1 : a)
+#define CEILDIV(a,b) (((a) + (b) - 1) / (b))
 
 #if defined (__APPLE__)
 #define __stdcall
diff --git a/src/opencl.c b/src/opencl.c
index 8adac3e6c..311a0f2d6 100644
--- a/src/opencl.c
+++ b/src/opencl.c
@@ -1366,7 +1366,7 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con
     {
       if (hashconfig->opti_type & OPTI_TYPE_SLOW_HASH_SIMD)
       {
-        num_elements = CEIL (num_elements / device_param->vector_width);
+        num_elements = CEILDIV (num_elements, device_param->vector_width);
       }
     }