diff --git a/advanced_help.module b/advanced_help.module
index ad55411..eab2a13 100644
--- a/advanced_help.module
+++ b/advanced_help.module
@@ -481,50 +481,59 @@ function theme_advanced_help_topic($variables) {
   $module = $variables['module'];
   $topic  = $variables['topic'];
   $type   = $variables['type'];
-
-  $info = advanced_help_get_topic($module, $topic);
-  if (!$info) {
-    return;
-  }
+  $info = array();
+  $attributes = array(
+    'attributes' => array(),
+    'html' => TRUE
+  );
 
   switch ($type) {
     case 'icon':
       $text = '<span>' . t('Help') . '</span>';
-      $class = 'advanced-help-link';
+      $attributes['attributes']['class'] = 'advanced-help-link';
       break;
 
     case 'title':
       $text = $info['title'];
-      $class = 'advanced-help-title';
+      $attributes['attributes']['class'] = 'advanced-help-title';
       break;
 
     default:
-      $class = 'advanced-help-title';
       $text = $type;
+      $attributes['attributes']['class'] = 'advanced-help-title';
       break;
   }
 
-  if (user_access('view advanced help popup')) {
-    drupal_add_css(drupal_get_path('module', 'advanced_help') . '/help-icon.css');
-    return l($text, "help/$module/$topic", array(
-      'attributes' => array(
-        'class' => $class,
-        'onclick' => "var w=window.open(this.href, 'advanced_help_window', 'width=" . $info['popup width'] . ",height=" . $info['popup height'] . ",scrollbars,resizable'); w.focus(); return false;",
-        'title' => $info['title']
-      ),
-      'query' => array('popup' => TRUE),
-      'html' => TRUE)
-    );
+  if (!$topic && !$module) {
+    // if no module and no topic have been specified, let's display the general index
+    $link = 'admin/advanced_help';
+    $attributes['attributes']['title'] = t('Advanced Help Index');
+  }
+  elseif (!$topic) {
+    // only the module name is available, let's display the module advanced help index
+    $link = 'admin/advanced_help/' . $module;
+    $attributes['attributes']['title'] = t('Advanced Help Index For %module', array('%module' => $module));
+  }
+  elseif ($info = advanced_help_get_topic($module, $topic)) {
+    $link = 'help/' . $module . '/' . $topic;
+    $attributes['attributes']['title'] = $info['title'];
   }
   else {
-    return l($text, "help/$module/$topic", array(
-      'attributes' => array(
-        'class' => $class,
-        'title' => $info['title']
-      ),
-      'html' => TRUE)
-    );
+    // Couldn't find any help, just return nothing
+    return;
   }
+
+  // Add the popup stuff if required
+  if (user_access('view advanced help popup')) {
+    // default height/width
+    $width = isset($info['popup_width']) ? $info['popup_width'] : 200;
+    $height = isset($info['popup_height']) ? $info['popup_height'] : 200;
+    drupal_add_css(drupal_get_path('module', 'advanced_help') . '/help-icon.css');
+    $attributes['attributes']['onclick'] = "var w=window.open(this.href, 'advanced_help_window', 'width=" . $width . ",height=" . $height . ",scrollbars,resizable'); w.focus(); return false;";
+    $attributes['query'] = array('popup' => TRUE);
+  }
+
+  return l($text, $link, $attributes);
 }
 
 /**
