           $set: root: root ? child
         ,
           multi: true
-    else
-      ## To reparent root message, change the root of all descendants.
+    else if cmsg.children?.length
+      ## To reparent root message (with children),
+      ## change the root of all descendants.
       Messages.update
         root: child
       ,

  Messages._ensureIndex [
    ['group', 1]
    ['updated', -1]
  ]

@rootMessages = (group) ->

      $set: root: root
    if cmsg.root?
      ## If we move a nonroot message to have new root, update descendants.
      descendants = descendantMessageIds cmsg
      if descendants.length > 0
        Messages.update
          _id: $in: descendants
