diff --git a/cache_consistent.inc b/cache_consistent.inc
index 8242f1c..0e0a8a2 100644
--- a/cache_consistent.inc
+++ b/cache_consistent.inc
@@ -113,10 +113,12 @@ class ConsistentCacheBase implements DrupalCacheInterface, DrupalTransactionalCa
    *   Cache operation if found, NULL otherwise.
    */
   protected function matchKey($cid) {
+    $cid = (string) $cid;
     if (!empty($this->buffer)) {
       $operation = end($this->buffer);
       do {
-        if (strpos($cid, $operation[2]) === 0) {
+        $key = (string) $operation[2];
+        if ($cid === $key || strpos($cid, $key) === 0) {
           return $operation;
         }
       } while ($operation = prev($this->buffer));
