--- a/lib/ii.c
+++ b/lib/ii.c
@@ -10874,7 +10874,9 @@
     ? ((uint32_t)(data->optarg->similarity_threshold) > GRN_HASH_SIZE(h)
        ? GRN_HASH_SIZE(h)
        :(uint32_t)(data->optarg->similarity_threshold))
-    : (GRN_HASH_SIZE(h) >> 3) + 1;
+    : (GRN_HASH_SIZE(h) < 8
+       ? GRN_HASH_SIZE(h)
+       : ((GRN_HASH_SIZE(h) - 8) >> 3) + 8);
   if (GRN_HASH_SIZE(h)) {
     grn_id j, id;
     float w2;
