--- comment.module_5p18_original	2009-04-29 14:32:15.000000000 -0400
+++ comment.module	2009-06-13 00:24:48.000000000 -0400
@@ -738,7 +738,7 @@ function comment_save($edit) {
         if ($edit['pid'] == 0) {
           // This is a comment with no parent comment (depth 0): we start
           // by retrieving the maximum thread level.
-          $max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d', $edit['nid']));
+          $max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d and pid = 0', $edit['nid']));
 
           // Strip the "/" from the end of the thread.
           $max = rtrim($max, '/');
