diff --git a/includes/common.inc b/includes/common.inc
index d34c19d..80a846c 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -4697,7 +4697,7 @@ function drupal_get_library($module, $name = NULL) {
  * @see block-admin-display-form.tpl.php
  * @see theme_menu_overview_form()
  */
-function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgroup = NULL, $source = NULL, $hidden = TRUE, $limit = 0) {
+function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgroup = NULL, $source = NULL, $hidden = TRUE, $limit = -1) {
   $js_added = &drupal_static(__FUNCTION__, FALSE);
   if (!$js_added) {
     // Add the table drag JavaScript to the page before the module JavaScript
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index b9b5822..bbbd2f8 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -42,7 +42,7 @@ Drupal.tableDrag = function (table, tableSettings) {
   this.oldRowElement = null; // Remember the previous element.
   this.oldY = 0; // Used to determine up or down direction from last mouse move.
   this.changed = false; // Whether anything in the entire table has changed.
-  this.maxDepth = 0; // Maximum amount of allowed parenting.
+  this.maxDepth = -1; // Maximum amount of allowed parenting.
   this.rtl = $(this.table).css('direction') == 'rtl' ? -1 : 1; // Direction of the table.
 
   // Configure the scroll settings.
@@ -60,7 +60,7 @@ Drupal.tableDrag = function (table, tableSettings) {
       if (tableSettings[group][n].relationship == 'parent') {
         this.indentEnabled = true;
       }
-      if (tableSettings[group][n].limit > 0) {
+      if (tableSettings[group][n].limit > -1) {
         this.maxDepth = tableSettings[group][n].limit;
       }
     }
@@ -1013,7 +1013,7 @@ Drupal.tableDrag.prototype.row.prototype.validIndentInterval = function (prevRow
     // Do not go deeper than as a child of the previous row.
     maxIndent = $('.indentation', prevRow).size() + ($(prevRow).is('.tabledrag-leaf') ? 0 : 1);
     // Limit by the maximum allowed depth for the table.
-    if (this.maxDepth) {
+    if (this.maxDepth > -1) {
       maxIndent = Math.min(maxIndent, this.maxDepth - (this.groupDepth - this.indents));
     }
   }
