diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go
index 96c4b0e6c4924f152cd76b445f5f02f0c812ab39..b4494d0d61056eeffe0c609fd7cbe092bbccd8ef 100644
--- a/whisper/whisperv5/api.go
+++ b/whisper/whisperv5/api.go
@@ -562,7 +562,7 @@ func (api *PublicWhisperAPI) NewMessageFilter(req Criteria) (string, error) {
 	}
 
 	if len(req.Topics) > 0 {
-		topics = make([][]byte, 1)
+		topics = make([][]byte, 0, len(req.Topics))
 		for _, topic := range req.Topics {
 			topics = append(topics, topic[:])
 		}
diff --git a/whisper/whisperv5/filter.go b/whisper/whisperv5/filter.go
index b5e893e0ff5c026d57c13449a7698b1439866560..3190334ebbe3d9c22bfcbf3ee9a3955ab24788bf 100644
--- a/whisper/whisperv5/filter.go
+++ b/whisper/whisperv5/filter.go
@@ -216,8 +216,12 @@ func (f *Filter) MatchTopic(topic TopicType) bool {
 }
 
 func matchSingleTopic(topic TopicType, bt []byte) bool {
-	if len(bt) > 4 {
-		bt = bt[:4]
+	if len(bt) > TopicLength {
+		bt = bt[:TopicLength]
+	}
+
+	if len(bt) < TopicLength {
+		return false
 	}
 
 	for j, b := range bt {
diff --git a/whisper/whisperv5/filter_test.go b/whisper/whisperv5/filter_test.go
index 72568b94e6d3385ed827435f848c5136fc479d24..01034a351386046a4e94500fad796ce0e0596ed4 100644
--- a/whisper/whisperv5/filter_test.go
+++ b/whisper/whisperv5/filter_test.go
@@ -776,6 +776,7 @@ func TestWatchers(t *testing.T) {
 func TestVariableTopics(t *testing.T) {
 	InitSingleTest()
 
+	const lastTopicByte = 3
 	var match bool
 	params, err := generateMessageParams()
 	if err != nil {
@@ -796,19 +797,52 @@ func TestVariableTopics(t *testing.T) {
 	}
 
 	for i := 0; i < 4; i++ {
-		arr := make([]byte, i+1, 4)
-		copy(arr, env.Topic[:i+1])
-
-		f.Topics[4] = arr
+		env.Topic = BytesToTopic(f.Topics[i])
 		match = f.MatchEnvelope(env)
 		if !match {
 			t.Fatalf("failed MatchEnvelope symmetric with seed %d, step %d.", seed, i)
 		}
 
-		f.Topics[4][i]++
+		f.Topics[i][lastTopicByte]++
 		match = f.MatchEnvelope(env)
 		if match {
 			t.Fatalf("MatchEnvelope symmetric with seed %d, step %d: false positive.", seed, i)
 		}
 	}
 }
+
+func TestMatchSingleTopic_ReturnTrue(t *testing.T) {
+	bt := []byte("test")
+	topic := BytesToTopic(bt)
+
+	if !matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
+
+func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) {
+	bt := []byte("test with tail")
+	topic := BytesToTopic([]byte("test"))
+
+	if !matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
+
+func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) {
+	bt := []byte("tes")
+	topic := BytesToTopic(bt)
+
+	if matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
+
+func TestMatchSingleTopic_InsufficientLength_ReturnFalse(t *testing.T) {
+	bt := []byte("test")
+	topic := BytesToTopic([]byte("not_equal"))
+
+	if matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go
index 0e8490b41956f53eeea9e223b641ffea84cc4e2f..2f6f671e9ed89405b105b48c6b30295e0c4b4e24 100644
--- a/whisper/whisperv6/api.go
+++ b/whisper/whisperv6/api.go
@@ -567,7 +567,7 @@ func (api *PublicWhisperAPI) NewMessageFilter(req Criteria) (string, error) {
 	}
 
 	if len(req.Topics) > 0 {
-		topics = make([][]byte, 1)
+		topics = make([][]byte, 0, len(req.Topics))
 		for _, topic := range req.Topics {
 			topics = append(topics, topic[:])
 		}
diff --git a/whisper/whisperv6/filter.go b/whisper/whisperv6/filter.go
index 2f52dd6b988ac1b8eff101ec7d7241cdc16a66b8..a752c7ac9a86246044ade9250679311345f11255 100644
--- a/whisper/whisperv6/filter.go
+++ b/whisper/whisperv6/filter.go
@@ -221,8 +221,12 @@ func (f *Filter) MatchTopic(topic TopicType) bool {
 }
 
 func matchSingleTopic(topic TopicType, bt []byte) bool {
-	if len(bt) > 4 {
-		bt = bt[:4]
+	if len(bt) > TopicLength {
+		bt = bt[:TopicLength]
+	}
+
+	if len(bt) < TopicLength {
+		return false
 	}
 
 	for j, b := range bt {
diff --git a/whisper/whisperv6/filter_test.go b/whisper/whisperv6/filter_test.go
index e2877b233cc89dccfdb7ccd6dd205673bdf486c0..9c7fdad95a82c2fa07a8166ccbfe8407db87600f 100644
--- a/whisper/whisperv6/filter_test.go
+++ b/whisper/whisperv6/filter_test.go
@@ -800,6 +800,7 @@ func TestWatchers(t *testing.T) {
 func TestVariableTopics(t *testing.T) {
 	InitSingleTest()
 
+	const lastTopicByte = 3
 	var match bool
 	params, err := generateMessageParams()
 	if err != nil {
@@ -820,19 +821,52 @@ func TestVariableTopics(t *testing.T) {
 	}
 
 	for i := 0; i < 4; i++ {
-		arr := make([]byte, i+1, 4)
-		copy(arr, env.Topic[:i+1])
-
-		f.Topics[4] = arr
+		env.Topic = BytesToTopic(f.Topics[i])
 		match = f.MatchEnvelope(env)
 		if !match {
 			t.Fatalf("failed MatchEnvelope symmetric with seed %d, step %d.", seed, i)
 		}
 
-		f.Topics[4][i]++
+		f.Topics[i][lastTopicByte]++
 		match = f.MatchEnvelope(env)
 		if match {
 			t.Fatalf("MatchEnvelope symmetric with seed %d, step %d: false positive.", seed, i)
 		}
 	}
 }
+
+func TestMatchSingleTopic_ReturnTrue(t *testing.T) {
+	bt := []byte("test")
+	topic := BytesToTopic(bt)
+
+	if !matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
+
+func TestMatchSingleTopic_WithTail_ReturnTrue(t *testing.T) {
+	bt := []byte("test with tail")
+	topic := BytesToTopic([]byte("test"))
+
+	if !matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
+
+func TestMatchSingleTopic_NotEquals_ReturnFalse(t *testing.T) {
+	bt := []byte("tes")
+	topic := BytesToTopic(bt)
+
+	if matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}
+
+func TestMatchSingleTopic_InsufficientLength_ReturnFalse(t *testing.T) {
+	bt := []byte("test")
+	topic := BytesToTopic([]byte("not_equal"))
+
+	if matchSingleTopic(topic, bt) {
+		t.FailNow()
+	}
+}