diff --git a/site_map.admin.inc b/site_map.admin.inc
index 4b01f7d..db7893d 100644
--- a/site_map.admin.inc
+++ b/site_map.admin.inc
@@ -129,10 +129,10 @@ function site_map_admin_settings_form() {
   $form['site_map_taxonomy_options']['site_map_categories_depth'] = array(
     '#type' => 'textfield',
     '#title' => t('Categories depth'),
-    '#default_value' => variable_get('site_map_categories_depth', 'all'),
+    '#default_value' => variable_get('site_map_categories_depth', NULL),
     '#size' => 3,
     '#maxlength' => 10,
-    '#description' => t('Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories, "0" to include no subcategories, or "-1" not to append the depth at all.'),
+    '#description' => t('Specify how many subcategories should be included on the categorie page. Leave empty to return all levels.'),
   );
   $form['site_map_taxonomy_options']['site_map_term_threshold'] = array(
     '#type' => 'textfield',
diff --git a/site_map.module b/site_map.module
index e18dab5..89ba307 100644
--- a/site_map.module
+++ b/site_map.module
@@ -512,8 +512,9 @@ function _site_map_taxonomy_tree($vid, $name = NULL, $description = NULL) {
 
   $output .= !empty($description) && variable_get('site_map_show_description', 1) ? '<div class="description">' . filter_xss_admin($description) . "</div>\n" : '';
 
+  $site_map_categories_depth = variable_get('site_map_categories_depth') ? variable_get('site_map_categories_depth') : NULL;
   // taxonomy_get_tree() honors access controls.
-  $tree = taxonomy_get_tree($vid);
+  $tree = taxonomy_get_tree($vid, 0, $site_map_categories_depth);
   foreach ($tree as $term) {
     $term->count = site_map_taxonomy_term_count_nodes($term->tid);
     if ($term->count <= $threshold) {
