diff --git a/core/DataTable.php b/core/DataTable.php
index efe05a4d7c987bd280e08762ca7b90e007dbecfc..c4cfb957307ee2805d4faf0e9313ba5fc9020bb4 100644
--- a/core/DataTable.php
+++ b/core/DataTable.php
@@ -1322,14 +1322,14 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
             if (is_array($rows[self::ID_SUMMARY_ROW])) {
                 $this->summaryRow = new Row($rows[self::ID_SUMMARY_ROW]);
             } elseif (isset($rows[self::ID_SUMMARY_ROW]->c)) {
-                $this->summaryRow = new Row($rows[self::ID_SUMMARY_ROW]->c);
+                $this->summaryRow = new Row($rows[self::ID_SUMMARY_ROW]->c); // Pre Piwik 2.13
             }
             unset($rows[self::ID_SUMMARY_ROW]);
         }
 
         foreach ($rows as $id => $row) {
             if (isset($row->c)) {
-                $this->addRow(new Row($row->c));
+                $this->addRow(new Row($row->c)); // Pre Piwik 2.13
             } else {
                 $this->addRow(new Row($row));
             }
diff --git a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
index d879c07fb7b3b183caaee7b015ee80001fa6194b..83110d149a724f41444c4951a66a4378be75e77c 100755
--- a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
+++ b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
@@ -182,15 +182,16 @@ class OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest extends SystemTestCa
             'archive_blob_2011_01'    => 3,
         );
         $chunk = new Chunk();
+        $chunkName = $chunk->getRecordNameForTableId('Actions_actions_url', 0);
+
         foreach ($tests as $table => $expectedNumSubtables) {
-            $chunkAppendix = $chunk->getRecordNameForTableId(0);
-            $sql = "SELECT value FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'] . " and `name` ='Actions_actions_url_$chunkAppendix'";
+            $sql = "SELECT value FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'] . " and `name` ='$chunkName'";
             $blob = Db::get()->fetchOne($sql);
             $blob = gzuncompress($blob);
             $blob = unserialize($blob);
             $countSubtables = count($blob);
 
-            $this->assertEquals($expectedNumSubtables, $countSubtables, "Actions_actions_url_subtables in $table expected to contain $expectedNumSubtables subtables, got $countSubtables");
+            $this->assertEquals($expectedNumSubtables, $countSubtables, "Actions_actions_url_chunk_0_99 in $table expected to contain $expectedNumSubtables subtables, got $countSubtables");
         }
     }
 
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
index a2c1d066723674df9095c86af029f54db541376a..05f6ef79d9cd50bbf5cc5fa99ab0f86f002e2c86 100755
--- a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
@@ -117,24 +117,23 @@ class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends SystemTest
     public function test_checkArchiveRecords_shouldMergeSubtablesIntoOneRow()
     {
         $chunk = new Chunk();
-        $chunkBlobId = $chunk->getRecordNameForTableId(0);
 
         $tests = array(
             'archive_blob_2010_01' => array(
-                'CustomVariables_valueByName_' . $chunkBlobId => 6,
-                'Referrers_keywordBySearchEngine_' . $chunkBlobId => 1,
-                'Referrers_searchEngineByKeyword_' . $chunkBlobId => 1,
+                $chunk->getRecordNameForTableId('CustomVariables_valueByName', 0) => 6,
+                $chunk->getRecordNameForTableId('Referrers_keywordBySearchEngine', 0) => 1,
+                $chunk->getRecordNameForTableId('Referrers_searchEngineByKeyword', 0) => 1
             ),
             'archive_blob_2009_12' => array(
-                'CustomVariables_valueByName_' . $chunkBlobId => 6,
-                'Referrers_keywordBySearchEngine_' . $chunkBlobId => 1,
-                'Referrers_searchEngineByKeyword_' . $chunkBlobId => 1,
+                $chunk->getRecordNameForTableId('CustomVariables_valueByName', 0) => 6,
+                $chunk->getRecordNameForTableId('Referrers_keywordBySearchEngine', 0) => 1,
+                $chunk->getRecordNameForTableId('Referrers_searchEngineByKeyword', 0) => 1,
             )
         );
         $numTests = 0;
         foreach ($tests as $table => $expectedSubtables) {
             foreach ($expectedSubtables as $name => $expectedNumSubtables) {
-                $sql = "SELECT `value` FROM " . Common::prefixTable($table) . " WHERE `name` ='$name'";
+                $sql   = "SELECT `value` FROM " . Common::prefixTable($table) . " WHERE `name` ='$name'";
                 $blobs = Db::get()->fetchAll($sql);
 
                 foreach ($blobs as $blob) {
diff --git a/tests/PHPUnit/Unit/Archive/ChunkTest.php b/tests/PHPUnit/Unit/Archive/ChunkTest.php
index dcab94c267ea8f88d011cb8d64058436e9eb1e6c..3518d5d87f86b0b7d2da3a76601f652b3b13107b 100644
--- a/tests/PHPUnit/Unit/Archive/ChunkTest.php
+++ b/tests/PHPUnit/Unit/Archive/ChunkTest.php
@@ -40,7 +40,7 @@ class ChunkTest extends UnitTestCase
         $this->assertEquals($this->recordName . '_chunk_' . $expectedChunk, $this->chunk->getRecordNameForTableId($this->recordName, $tableId));
     }
 
-    public function getRecordNameForTableId()
+    public function getRecordNameForTableIdDataProvider()
     {
         return array(
             array($expectedChunk = '0_99', $tableId = 0),