diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index a359981..191dbea 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -180,6 +180,7 @@ function statistics_menu() {
   $items['user/%user/track/navigation'] = array(
     'title' => 'Page visits',
     'page callback' => 'statistics_user_tracker',
+    'page arguments' => array(1),
     'access callback' => 'user_access',
     'access arguments' => array('access statistics'),
     'type' => MENU_LOCAL_TASK,
@@ -189,6 +190,7 @@ function statistics_menu() {
   $items['node/%node/track'] = array(
     'title' => 'Track',
     'page callback' => 'statistics_node_tracker',
+    'page arguments' => array(1),
     'access callback' => 'user_access',
     'access arguments' => array('access statistics'),
     'type' => MENU_LOCAL_TASK,
diff --git a/core/modules/statistics/statistics.pages.inc b/core/modules/statistics/statistics.pages.inc
index 6cf110c..7ecfca1 100644
--- a/core/modules/statistics/statistics.pages.inc
+++ b/core/modules/statistics/statistics.pages.inc
@@ -16,64 +16,59 @@
  *
  * @see statistics_menu()
  */
-function statistics_node_tracker() {
-  if ($node = node_load(arg(1))) {
-    $header = array(
-      array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
-      array('data' => t('Referrer'), 'field' => 'a.url'),
-      array('data' => t('User'), 'field' => 'u.name'),
-      t('Operations'),
-    );
-
-    $query = db_select('accesslog', 'a', array('target' => 'slave'))
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('Drupal\Core\Database\Query\TableSortExtender');
-    $query->join('users', 'u', 'a.uid = u.uid');
+function statistics_node_tracker($node) {
+  $header = array(
+    array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
+    array('data' => t('Referrer'), 'field' => 'a.url'),
+    array('data' => t('User'), 'field' => 'u.name'),
+    t('Operations'),
+  );
 
-    $query
-      ->fields('a', array('aid', 'timestamp', 'url', 'uid'))
-      ->fields('u', array('name'))
-      ->condition(db_or()
-        ->condition('a.path', 'node/' . $node->nid)
-        ->condition('a.path', 'node/' . $node->nid . '/%', 'LIKE'))
-      ->limit(30)
-      ->orderByHeader($header);
+  $query = db_select('accesslog', 'a', array('target' => 'slave'))
+    ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+    ->extend('Drupal\Core\Database\Query\TableSortExtender');
+  $query->join('users', 'u', 'a.uid = u.uid');
 
-    $result = $query->execute();
-    $rows = array();
-    foreach ($result as $log) {
-      $row = array();
-      $row[] = array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap'));
-      $row[] = _statistics_link($log->url);
-      $row[] = theme('username', array('account' => $log));
-      $links = array();
-      $links['details'] = array(
-        'title' => t('details'),
-        'href' => "admin/reports/access/$log->aid",
-      );
-      $row[] = array(
-        'data' => array(
-          '#type' => 'operations',
-          '#links' => $links,
-        ),
-      );
-      $rows[] = $row;
-    }
+  $query
+    ->fields('a', array('aid', 'timestamp', 'url', 'uid'))
+    ->fields('u', array('name'))
+    ->condition(db_or()
+      ->condition('a.path', 'node/' . $node->nid)
+      ->condition('a.path', 'node/' . $node->nid . '/%', 'LIKE'))
+    ->limit(30)
+    ->orderByHeader($header);
 
-    // Do not use $node->label() here, because $node comes from the database.
-    drupal_set_title($node->title);
-    $build['statistics_table'] = array(
-      '#theme' => 'table',
-      '#header' => $header,
-      '#rows' => $rows,
-      '#empty' => t('No statistics available.'),
+  $result = $query->execute();
+  $rows = array();
+  foreach ($result as $log) {
+    $row = array();
+    $row[] = array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap'));
+    $row[] = _statistics_link($log->url);
+    $row[] = theme('username', array('account' => $log));
+    $links = array();
+    $links['details'] = array(
+      'title' => t('details'),
+      'href' => "admin/reports/access/$log->aid",
     );
-    $build['statistics_pager'] = array('#theme' => 'pager');
-    return $build;
-  }
-  else {
-    throw new NotFoundHttpException();
+    $row[] = array(
+      'data' => array(
+        '#type' => 'operations',
+        '#links' => $links,
+      ),
+    );
+    $rows[] = $row;
   }
+
+  // Do not use $node->label() here, because $node comes from the database.
+  drupal_set_title($node->title);
+  $build['statistics_table'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#empty' => t('No statistics available.'),
+  );
+  $build['statistics_pager'] = array('#theme' => 'pager');
+  return $build;
 }
 
 /**
@@ -85,54 +80,48 @@ function statistics_node_tracker() {
  *
  * @see statistics_menu()
  */
-function statistics_user_tracker() {
-  if ($account = user_load(arg(1))) {
+function statistics_user_tracker($account) {
+  $header = array(
+    array('data' => t('Timestamp'), 'field' => 'timestamp', 'sort' => 'desc'),
+    array('data' => t('Page'), 'field' => 'path'),
+    t('Operations'),
+  );
+  $query = db_select('accesslog', 'a', array('target' => 'slave'))
+    ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
+    ->extend('Drupal\Core\Database\Query\TableSortExtender');
+  $query
+    ->fields('a', array('aid', 'timestamp', 'path', 'title'))
+    ->condition('uid', $account->uid)
+    ->limit(30)
+    ->orderByHeader($header);
 
-    $header = array(
-      array('data' => t('Timestamp'), 'field' => 'timestamp', 'sort' => 'desc'),
-      array('data' => t('Page'), 'field' => 'path'),
-      t('Operations'),
+  $result = $query->execute();
+  $rows = array();
+  foreach ($result as $log) {
+    $row = array();
+    $row[] = array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap'));
+    $row[] = _statistics_format_item($log->title, $log->path);
+    $links = array();
+    $links['details'] = array(
+      'title' => t('details'),
+      'href' => "admin/reports/access/$log->aid",
     );
-    $query = db_select('accesslog', 'a', array('target' => 'slave'))
-      ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
-      ->extend('Drupal\Core\Database\Query\TableSortExtender');
-    $query
-      ->fields('a', array('aid', 'timestamp', 'path', 'title'))
-      ->condition('uid', $account->uid)
-      ->limit(30)
-      ->orderByHeader($header);
-
-    $result = $query->execute();
-    $rows = array();
-    foreach ($result as $log) {
-      $row = array();
-      $row[] = array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap'));
-      $row[] = _statistics_format_item($log->title, $log->path);
-      $links = array();
-      $links['details'] = array(
-        'title' => t('details'),
-        'href' => "admin/reports/access/$log->aid",
-      );
-      $row[] = array(
-        'data' => array(
-          '#type' => 'operations',
-          '#links' => $links,
-        ),
-      );
-      $rows[] = $row;
-    }
-
-    drupal_set_title(user_format_name($account));
-    $build['statistics_table'] = array(
-      '#theme' => 'table',
-      '#header' => $header,
-      '#rows' => $rows,
-      '#empty' => t('No statistics available.'),
+    $row[] = array(
+      'data' => array(
+        '#type' => 'operations',
+        '#links' => $links,
+      ),
     );
-    $build['statistics_pager'] = array('#theme' => 'pager');
-    return $build;
-  }
-  else {
-    throw new NotFoundHttpException();
+    $rows[] = $row;
   }
+
+  drupal_set_title(user_format_name($account));
+  $build['statistics_table'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#empty' => t('No statistics available.'),
+  );
+  $build['statistics_pager'] = array('#theme' => 'pager');
+  return $build;
 }
