diff --git a/bawstats.install b/bawstats.install
index 156e185..6aefc9b 100644
--- a/bawstats.install
+++ b/bawstats.install
@@ -1,4 +1,4 @@
-<?php 
+<?php
 
 /**
  *  Rebuild menu to update menus to new structure.
@@ -18,4 +18,13 @@ function bawstats_update_6001() {
     $ret[] = array('success' => FALSE, 'query' => 'The <a href="http://www.drupal.org/project/libraries">Libraries API module</a> needs to be installed and enabled for bawstats to function after this update.');
   }
   return($ret);
-}
\ No newline at end of file
+}
+
+/**
+ *  Rebuild menu to update menus to new structure.
+ */
+function bawstats_update_6002() {
+  $ret = array();
+  menu_rebuild();
+  return($ret);
+}
diff --git a/bawstats.module b/bawstats.module
index 63a34c2..422a2c9 100644
--- a/bawstats.module
+++ b/bawstats.module
@@ -141,16 +141,19 @@ function bawstats_menu() {
   }
 
   // the "other" more specific things we don't have menus for!
-  $items['admin/reports/bawstats/details/%/%/%'] = array(
-    'title' => $group_details,
-    'type' => MENU_CALLBACK,
-    'page callback' => 'bawstats_view_theform',
-    'page arguments' => array(5,6,4),
-    'file' => 'bawstats.stats.inc',
-    'file path' => $includes_path,
-    'weight' => $pri,
-    'access arguments' => array('view site statistics')
-  );
+  $statsections = variable_get('bawstats_sections', array());
+  foreach ($statsections as $key => $value) {
+    $items['admin/reports/bawstats/details/' . $key . '/%/%'] = array(
+      'title' => $value['name'],
+      'type' => MENU_CALLBACK,
+      'page callback' => 'bawstats_view_theform',
+      'page arguments' => array(5, 6, $key),
+      'file' => 'bawstats.stats.inc',
+      'file path' => $includes_path,
+      'weight' => 1,
+      'access arguments' => array('view site statistics')
+    );
+  }
 
   return $items;
 }
diff --git a/includes/bawstats.admin.inc b/includes/bawstats.admin.inc
index e693d80..a745dd5 100644
--- a/includes/bawstats.admin.inc
+++ b/includes/bawstats.admin.inc
@@ -265,9 +265,11 @@ function bawstats_admin_settings_submit($form, &$form_state) {
     // similarly with the stat sections
     $statsections = array();
     foreach ($BAW_CONF_DIS_DEF as $key => $value) {
-      $statgroups[] = $key;
+      $value['name'] = check_plain($value['name']);
+      $value['help'] = check_plain($value['help']);
+      $statsections[check_plain($key)] = $value;
     }
-    variable_set('bawstats_sections',$statsections);
+    variable_set('bawstats_sections', $statsections);
   }
 
   menu_rebuild();
