diff --git a/src/lib-sieve/mcht-contains.c b/src/lib-sieve/mcht-contains.c
index d68e4409756bb5c56ea31176cb9efa2bb72c52ac..d1e6354f13b3232e52c1c53a40f2a39e6e1b46b9 100644
--- a/src/lib-sieve/mcht-contains.c
+++ b/src/lib-sieve/mcht-contains.c
@@ -50,17 +50,17 @@ static int mcht_contains_match_key
 	const char *kp = key;
 
 	if ( val_size == 0 )
-		return ( key_size == 0 );
+		return ( key_size == 0 ? 1 : 0 );
 
 	if ( cmp->def == NULL || cmp->def->char_match == NULL )
-		return FALSE;
+		return 0;
 
 	while ( (vp < vend) && (kp < kend) ) {
 		if ( !cmp->def->char_match(cmp, &vp, vend, &kp, kend) )
 			vp++;
 	}
 
-	return (kp == kend);
+	return ( kp == kend ? 1 : 0 );
 }
 
 
diff --git a/src/lib-sieve/mcht-is.c b/src/lib-sieve/mcht-is.c
index a637790b86c60ff593df2140ddb808ec5970a4a4..ac6a19ba57bbca58710d7045cb107d841596e505 100644
--- a/src/lib-sieve/mcht-is.c
+++ b/src/lib-sieve/mcht-is.c
@@ -41,12 +41,12 @@ static int mcht_is_match_key
 	const char *key, size_t key_size)
 {
 	if ( val_size == 0 )
-		return ( key_size == 0 );
+		return ( key_size == 0 ? 1 : 0 );
 
 	if ( mctx->comparator->def != NULL && mctx->comparator->def->compare != NULL )
 		return (mctx->comparator->def->compare(mctx->comparator,
 			val, val_size, key, key_size) == 0);
 
-	return FALSE;
+	return 0;
 }
 
diff --git a/src/lib-sieve/mcht-matches.c b/src/lib-sieve/mcht-matches.c
index 02ce2a83328a7de9b28c7aadee8d03144f2ddac4..dcc08b8e90e9f263ff988dcbb01e73c2cabdf9ee 100644
--- a/src/lib-sieve/mcht-matches.c
+++ b/src/lib-sieve/mcht-matches.c
@@ -95,7 +95,7 @@ static int mcht_matches_match_key
 	unsigned int key_offset = 0;
 
 	if ( cmp->def == NULL || cmp->def->char_match == NULL )
-		return FALSE;
+		return 0;
 
 	/* Key sections */
 	section = t_str_new(32);    /* Section (after beginning or *) */
@@ -428,11 +428,11 @@ static int mcht_matches_match_key
 			/* Commit new match values */
 			sieve_match_values_commit(mctx->runenv, &mvalues);
 		}
-		return TRUE;
+		return 1;
 	}
 
 	/* No match; drop collected match values */
 	sieve_match_values_abort(&mvalues);
-	return FALSE;
+	return 0;
 }