Fix match search in encrypt mode