diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
index 3e2644cca0d9573d2fe6038459de127b425c9366..84ef4e46ba5208dc4eb4eef0912a383c90d8f5a8 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
@@ -1528,34 +1528,34 @@
 		<visitIp>175.41.192.40</visitIp>
 		
 		<actionDetails>
-			<row>
-				<type>goal</type>
-				<goalName>all</goalName>
-				<goalId>1</goalId>
-				<revenue>5</revenue>
-				<goalPageId>48</goalPageId>
-				
-				<url>http://piwik.net/blog/category/meta/</url>
-				<icon>plugins/Morpheus/images/goal.png</icon>
-			</row>
 			<row>
 				<type>action</type>
 				<url>http://piwik.net/blog/category/meta/</url>
 				<pageTitle />
 				<pageIdAction>1</pageIdAction>
 				
-				<pageId>56</pageId>
+				<pageId>48</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.02s</generationTime>
-				<timeSpent>52</timeSpent>
-				<timeSpentPretty>52s</timeSpentPretty>
+				<generationTime>0.12s</generationTime>
+				<timeSpent>0</timeSpent>
+				<timeSpentPretty>0s</timeSpentPretty>
 				<icon />
 			</row>
+			<row>
+				<type>goal</type>
+				<goalName>all</goalName>
+				<goalId>1</goalId>
+				<revenue>5</revenue>
+				<goalPageId>48</goalPageId>
+				
+				<url>http://piwik.net/blog/category/meta/</url>
+				<icon>plugins/Morpheus/images/goal.png</icon>
+			</row>
 			<row>
 				<type>action</type>
 				<url>http://piwik.net/blog/category/meta/</url>
@@ -1580,16 +1580,16 @@
 				<pageTitle />
 				<pageIdAction>1</pageIdAction>
 				
-				<pageId>48</pageId>
+				<pageId>56</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.12s</generationTime>
-				<timeSpent>0</timeSpent>
-				<timeSpentPretty>0s</timeSpentPretty>
+				<generationTime>0.02s</generationTime>
+				<timeSpent>52</timeSpent>
+				<timeSpentPretty>52s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
@@ -1598,16 +1598,16 @@
 				<pageTitle />
 				<pageIdAction>2</pageIdAction>
 				
-				<pageId>57</pageId>
+				<pageId>49</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.24s</generationTime>
-				<timeSpent>26</timeSpent>
-				<timeSpentPretty>26s</timeSpentPretty>
+				<generationTime>0.23s</generationTime>
+				<timeSpent>52</timeSpent>
+				<timeSpentPretty>52s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
@@ -1616,14 +1616,14 @@
 				<pageTitle />
 				<pageIdAction>2</pageIdAction>
 				
-				<pageId>49</pageId>
+				<pageId>53</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.23s</generationTime>
+				<generationTime>0.29s</generationTime>
 				<timeSpent>52</timeSpent>
 				<timeSpentPretty>52s</timeSpentPretty>
 				<icon />
@@ -1634,16 +1634,16 @@
 				<pageTitle />
 				<pageIdAction>2</pageIdAction>
 				
-				<pageId>53</pageId>
+				<pageId>57</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.29s</generationTime>
-				<timeSpent>52</timeSpent>
-				<timeSpentPretty>52s</timeSpentPretty>
+				<generationTime>0.24s</generationTime>
+				<timeSpent>26</timeSpent>
+				<timeSpentPretty>26s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
@@ -1652,16 +1652,16 @@
 				<pageTitle />
 				<pageIdAction>3</pageIdAction>
 				
-				<pageId>54</pageId>
+				<pageId>50</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.62s</generationTime>
-				<timeSpent>7</timeSpent>
-				<timeSpentPretty>7s</timeSpentPretty>
+				<generationTime>1.32s</generationTime>
+				<timeSpent>26</timeSpent>
+				<timeSpentPretty>26s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
@@ -1670,16 +1670,16 @@
 				<pageTitle />
 				<pageIdAction>3</pageIdAction>
 				
-				<pageId>50</pageId>
+				<pageId>54</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>1.32s</generationTime>
-				<timeSpent>26</timeSpent>
-				<timeSpentPretty>26s</timeSpentPretty>
+				<generationTime>0.62s</generationTime>
+				<timeSpent>7</timeSpent>
+				<timeSpentPretty>7s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
@@ -1688,14 +1688,16 @@
 				<pageTitle />
 				<pageIdAction>4</pageIdAction>
 				
-				<pageId>55</pageId>
+				<pageId>51</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.34s</generationTime>
+				<generationTime>0.54s</generationTime>
+				<timeSpent>7</timeSpent>
+				<timeSpentPretty>7s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
@@ -1704,16 +1706,14 @@
 				<pageTitle />
 				<pageIdAction>4</pageIdAction>
 				
-				<pageId>51</pageId>
+				<pageId>55</pageId>
 				<customVariables>
 					<row>
 						<customVariablePageName1>HTTP-code</customVariablePageName1>
 						<customVariablePageValue1>200</customVariablePageValue1>
 					</row>
 				</customVariables>
-				<generationTime>0.54s</generationTime>
-				<timeSpent>7</timeSpent>
-				<timeSpentPretty>7s</timeSpentPretty>
+				<generationTime>0.34s</generationTime>
 				<icon />
 			</row>
 		</actionDetails>
@@ -2118,6 +2118,24 @@
 		<visitIp>70.95.0.0</visitIp>
 		
 		<actionDetails>
+			<row>
+				<type>action</type>
+				<url>http://piwik.net/Products/theProduct</url>
+				<pageTitle />
+				<pageIdAction>55</pageIdAction>
+				
+				<pageId>58</pageId>
+				<customVariables>
+					<row>
+						<customVariablePageName1>HTTP-code</customVariablePageName1>
+						<customVariablePageValue1>200</customVariablePageValue1>
+					</row>
+				</customVariables>
+				<generationTime>0.11s</generationTime>
+				<timeSpent>0</timeSpent>
+				<timeSpentPretty>0s</timeSpentPretty>
+				<icon />
+			</row>
 			<row>
 				<type>goal</type>
 				<goalName>all</goalName>
@@ -2143,24 +2161,6 @@
 				</customVariables>
 				<icon />
 			</row>
-			<row>
-				<type>action</type>
-				<url>http://piwik.net/Products/theProduct</url>
-				<pageTitle />
-				<pageIdAction>55</pageIdAction>
-				
-				<pageId>58</pageId>
-				<customVariables>
-					<row>
-						<customVariablePageName1>HTTP-code</customVariablePageName1>
-						<customVariablePageValue1>200</customVariablePageValue1>
-					</row>
-				</customVariables>
-				<generationTime>0.11s</generationTime>
-				<timeSpent>0</timeSpent>
-				<timeSpentPretty>0s</timeSpentPretty>
-				<icon />
-			</row>
 		</actionDetails>
 		<goalConversions>1</goalConversions>
 		<siteCurrency>USD</siteCurrency>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml
index e0316013c34dde3dc4daea6511a75880d49fe42f..fcbdc9e2fd11341253c2a5f9293b7af63d1c89a5 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml
@@ -256,45 +256,45 @@
 			<row>
 				<type>action</type>
 				<url>http://example.org/user/profile</url>
-				<pageTitle>Profile page for user *_)%</pageTitle>
+				<pageTitle>Profile page</pageTitle>
 				<pageIdAction>4</pageIdAction>
 				
-				<pageId>3</pageId>
+				<pageId>2</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName1>Language</customVariablePageName1>
-						<customVariablePageValue1>FR</customVariablePageValue1>
-					</row>
-					<row>
-						<customVariablePageName2>SET WITH EMPTY VALUE PAGE SCOPE</customVariablePageName2>
-						<customVariablePageValue2 />
+						<customVariablePageName4>Status user</customVariablePageName4>
+						<customVariablePageValue4>Loggedin</customVariablePageValue4>
 					</row>
 					<row>
-						<customVariablePageName4>Status user</customVariablePageName4>
-						<customVariablePageValue4>looking at &quot;profile page&quot;</customVariablePageValue4>
+						<customVariablePageName5>Status user</customVariablePageName5>
+						<customVariablePageValue5>looking at &quot;profile page&quot;</customVariablePageValue5>
 					</row>
 				</customVariables>
+				<timeSpent>0</timeSpent>
+				<timeSpentPretty>0s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
 				<type>action</type>
 				<url>http://example.org/user/profile</url>
-				<pageTitle>Profile page</pageTitle>
+				<pageTitle>Profile page for user *_)%</pageTitle>
 				<pageIdAction>4</pageIdAction>
 				
-				<pageId>2</pageId>
+				<pageId>3</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName4>Status user</customVariablePageName4>
-						<customVariablePageValue4>Loggedin</customVariablePageValue4>
+						<customVariablePageName1>Language</customVariablePageName1>
+						<customVariablePageValue1>FR</customVariablePageValue1>
 					</row>
 					<row>
-						<customVariablePageName5>Status user</customVariablePageName5>
-						<customVariablePageValue5>looking at &quot;profile page&quot;</customVariablePageValue5>
+						<customVariablePageName2>SET WITH EMPTY VALUE PAGE SCOPE</customVariablePageName2>
+						<customVariablePageValue2 />
+					</row>
+					<row>
+						<customVariablePageName4>Status user</customVariablePageName4>
+						<customVariablePageValue4>looking at &quot;profile page&quot;</customVariablePageValue4>
 					</row>
 				</customVariables>
-				<timeSpent>0</timeSpent>
-				<timeSpentPretty>0s</timeSpentPretty>
 				<icon />
 			</row>
 		</actionDetails>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
index e0316013c34dde3dc4daea6511a75880d49fe42f..fcbdc9e2fd11341253c2a5f9293b7af63d1c89a5 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
@@ -256,45 +256,45 @@
 			<row>
 				<type>action</type>
 				<url>http://example.org/user/profile</url>
-				<pageTitle>Profile page for user *_)%</pageTitle>
+				<pageTitle>Profile page</pageTitle>
 				<pageIdAction>4</pageIdAction>
 				
-				<pageId>3</pageId>
+				<pageId>2</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName1>Language</customVariablePageName1>
-						<customVariablePageValue1>FR</customVariablePageValue1>
-					</row>
-					<row>
-						<customVariablePageName2>SET WITH EMPTY VALUE PAGE SCOPE</customVariablePageName2>
-						<customVariablePageValue2 />
+						<customVariablePageName4>Status user</customVariablePageName4>
+						<customVariablePageValue4>Loggedin</customVariablePageValue4>
 					</row>
 					<row>
-						<customVariablePageName4>Status user</customVariablePageName4>
-						<customVariablePageValue4>looking at &quot;profile page&quot;</customVariablePageValue4>
+						<customVariablePageName5>Status user</customVariablePageName5>
+						<customVariablePageValue5>looking at &quot;profile page&quot;</customVariablePageValue5>
 					</row>
 				</customVariables>
+				<timeSpent>0</timeSpent>
+				<timeSpentPretty>0s</timeSpentPretty>
 				<icon />
 			</row>
 			<row>
 				<type>action</type>
 				<url>http://example.org/user/profile</url>
-				<pageTitle>Profile page</pageTitle>
+				<pageTitle>Profile page for user *_)%</pageTitle>
 				<pageIdAction>4</pageIdAction>
 				
-				<pageId>2</pageId>
+				<pageId>3</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName4>Status user</customVariablePageName4>
-						<customVariablePageValue4>Loggedin</customVariablePageValue4>
+						<customVariablePageName1>Language</customVariablePageName1>
+						<customVariablePageValue1>FR</customVariablePageValue1>
 					</row>
 					<row>
-						<customVariablePageName5>Status user</customVariablePageName5>
-						<customVariablePageValue5>looking at &quot;profile page&quot;</customVariablePageValue5>
+						<customVariablePageName2>SET WITH EMPTY VALUE PAGE SCOPE</customVariablePageName2>
+						<customVariablePageValue2 />
+					</row>
+					<row>
+						<customVariablePageName4>Status user</customVariablePageName4>
+						<customVariablePageValue4>looking at &quot;profile page&quot;</customVariablePageValue4>
 					</row>
 				</customVariables>
-				<timeSpent>0</timeSpent>
-				<timeSpentPretty>0s</timeSpentPretty>
 				<icon />
 			</row>
 		</actionDetails>