--- comment.module.5p2	2007-07-26 15:16:45.000000000 -0400
+++ comment.module	2007-08-08 23:06:49.000000000 -0400
@@ -743,8 +743,12 @@ function comment_save($edit) {
           // Strip the "/" from the end of the thread.
           $max = rtrim($max, '/');
 
+          // We need to get the value at the correct depth
+          $parts = explode('.', $max);
+          $firstsegment = $parts[0];
+
           // Finally, build the thread field for this new comment.
-          $thread = int2vancode(vancode2int($max) + 1) .'/';
+          $thread = int2vancode(vancode2int($firstsegment) + 1) .'/';
         }
         else {
           // This is comment with a parent comment: we increase
