diff --git a/database/updates.inc b/database/updates.inc
index ae2932d941201e87f10d10d4848e091746256954..8dab69b031699ef57932a40ecec2d02a6159c34a 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1307,9 +1307,12 @@ function update_95() {
 function update_96() {
   $ret = array();
 
-  $ret[] = update_sql('ALTER TABLE {accesslog} DROP nid');
-  $ret[] = update_sql('ALTER TABLE {accesslog} ADD title VARCHAR(255) DEFAULT NULL');
   $ret[] = update_sql('ALTER TABLE {accesslog} ADD path VARCHAR(255) DEFAULT NULL');
+  $ret[] = update_sql('UPDATE {accesslog} SET path = CONCAT("node/", nid) WHERE nid != 0');
+  $ret[] = update_sql('ALTER TABLE {accesslog} ADD title VARCHAR(255) DEFAULT NULL');
+  /* Only supported by MySQL 4.0.4 and up
+  $ret[] = update_sql('UPDATE {accesslog} a, {node} n SET a.title = n.title WHERE a.nid = n.nid');*/
+  $ret[] = update_sql('ALTER TABLE {accesslog} DROP nid');
 
   if ($GLOBALS['db_type'] == 'mysql') {
     $ret[] = update_sql("ALTER TABLE {menu} ADD description varchar(255) DEFAULT '' NOT NULL");
diff --git a/modules/statistics.module b/modules/statistics.module
index a334ee6693349e3b950836ba2ea405b3f666108c..e33b56a458622f089c36d37001c4cc2e84c6cdb8 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -74,10 +74,9 @@ function statistics_exit() {
     // Statistical logs are enabled.
     $referrer = referer_uri();
     $hostname = $_SERVER['REMOTE_ADDR'];
-    $path = (drupal_get_path_alias($_GET['q'])) ? drupal_get_path_alias($_GET['q']) : $_GET['q'];
 
     // Log this page access.
-    db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $path, $referrer, $hostname, $user->uid, time());
+    db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $_GET['q'], $referrer, $hostname, $user->uid, time());
   }
 }
 
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index a334ee6693349e3b950836ba2ea405b3f666108c..e33b56a458622f089c36d37001c4cc2e84c6cdb8 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -74,10 +74,9 @@ function statistics_exit() {
     // Statistical logs are enabled.
     $referrer = referer_uri();
     $hostname = $_SERVER['REMOTE_ADDR'];
-    $path = (drupal_get_path_alias($_GET['q'])) ? drupal_get_path_alias($_GET['q']) : $_GET['q'];
 
     // Log this page access.
-    db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $path, $referrer, $hostname, $user->uid, time());
+    db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', %d, %d)", drupal_get_title(), $_GET['q'], $referrer, $hostname, $user->uid, time());
   }
 }