Index: modules/comment/comment.tokens.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.tokens.inc,v
retrieving revision 1.13
diff -u -p -r1.13 comment.tokens.inc
--- modules/comment/comment.tokens.inc	7 Jul 2010 17:00:42 -0000	1.13
+++ modules/comment/comment.tokens.inc	23 Sep 2010 01:44:13 -0000
@@ -132,12 +132,21 @@ function comment_tokens($type, $tokens, 
           break;
 
         case 'name':
-          $name = ($comment->uid == 0) ? variable_get('anonymous', t('Anonymous')) : $comment->name;
+        case 'author':
+          $name = $comment->name;
+          if ($comment->uid) {
+            // Registered users always have their name displayed.
+            $account = user_load($comment->uid);
+            $name = format_username($account);
+          }
+          elseif (!$comment->name) {
+            $name = variable_get('anonymous', t('Anonymous'));
+          }
           $replacements[$original] = $sanitize ? filter_xss($name) : $name;
           break;
 
         case 'mail':
-          if ($comment->uid != 0) {
+          if ($comment->uid) {
             $account = user_load($comment->uid);
             $mail = $account->mail;
           }
@@ -173,10 +182,6 @@ function comment_tokens($type, $tokens, 
           break;
 
         // Default values for the chained tokens handled below.
-        case 'author':
-          $replacements[$original] = $sanitize ? filter_xss($comment->name) : $comment->name;
-          break;
-
         case 'parent':
           if (!empty($comment->pid)) {
             $parent = comment_load($comment->pid);
Index: modules/user/user.tokens.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.tokens.inc,v
retrieving revision 1.7
diff -u -p -r1.7 user.tokens.inc
--- modules/user/user.tokens.inc	29 Jun 2010 18:24:10 -0000	1.7
+++ modules/user/user.tokens.inc	23 Sep 2010 01:44:13 -0000
@@ -86,7 +86,7 @@ function user_tokens($type, $tokens, arr
           break;
 
         case 'name':
-          $name = format_username($account);
+          $name = $account->uid ? format_username($account) : variable_get('anonymous', t('Anonymous'));
           $replacements[$original] = $sanitize ? filter_xss($name) : $name;
           break;
 
