Index: kernel/common/eztemplatedesignresource.php
===================================================================
--- kernel/common/eztemplatedesignresource.php	(revision 21373)
+++ kernel/common/eztemplatedesignresource.php	(working copy)
@@ -287,6 +287,8 @@
 
         $overrideCacheFile = $this->createOverrideCache();
 
+        $matchedKeys = array();
+
         if ( $overrideCacheFile )
         {
             include_once( $overrideCacheFile );
@@ -322,6 +324,7 @@
                 $matchFound = false;
                 foreach ( $matchFile['custom_match'] as $customMatch )
                 {
+                    $matchedKeys = array();
                     $matchOverride = true;
                     if ( count( $customMatch['conditions'] ) > 0 )
                     {
@@ -332,6 +335,7 @@
                             {
                                 if ( strpos( $matchKeys['url_alias'], $customMatch['conditions'][$conditionKey] ) === 0 )
                                 {
+                                    $matchedKeys[] = 'url_alias';
                                 }
                                 else
                                 {
@@ -343,13 +347,21 @@
                             {
                                 if ( is_array( $matchKeys[$conditionKey] ) )
                                 {
-                                    if ( !in_array( $customMatch['conditions'][$conditionKey], $matchKeys[$conditionKey] ) )
+                                    if ( in_array( $customMatch['conditions'][$conditionKey], $matchKeys[$conditionKey] ) )
                                     {
+                                        $matchedKeys[] = $conditionKey;
+                                    }
+                                    else
+                                    {
                                         $matchOverride = false;
                                     }
                                 }
-                                else if ( $matchKeys[$conditionKey] != $customMatch['conditions'][$conditionKey] )
+                                else if ( $matchKeys[$conditionKey] == $customMatch['conditions'][$conditionKey] )
                                 {
+                                    $matchedKeys[] = $conditionKey;
+                                }
+                                else
+                                {
                                     $matchOverride = false;
                                 }
                             }
@@ -389,7 +401,6 @@
 
         $file = $match["file"];
 
-        $matchedKeys = array();
         $usedKeys = array();
         foreach ( $matchKeys as $matchKeyName => $matchKeyValue )
         {
