diff --git a/masquerade.module b/masquerade.module
index b7b83bf..273c06d 100644
--- a/masquerade.module
+++ b/masquerade.module
@@ -303,7 +303,7 @@ function masquerade_user($op, &$edit, &$edit_user, $category = NULL) {
       global $user;
       if (user_access($perm) && empty($edit_user->masquerading) && $user->uid != $edit_user->uid) {
         $edit_user->content['Masquerade'] = array(
-          '#value' => l(t('Masquerade as !user', array('!user' => $edit_user->name)), 'masquerade/switch/'. $edit_user->uid, array('destination' => $_GET['q'], 'attributes' => array('class' => 'masquerade-switch'))),
+          '#value' => l(t('Masquerade as !user', array('!user' => theme('username', $edit_user->name))), 'masquerade/switch/'. $edit_user->uid, array('destination' => $_GET['q'], 'attributes' => array('class' => 'masquerade-switch'))),
           '#weight' => 10
         );
       }
@@ -401,7 +401,7 @@ function masquerade_block_1($record) {
   if ($_SESSION['masquerading']) {
     $quick_switch_link[] = l(t('Switch back'), 'masquerade/unswitch', array());
     if ($user->uid > 0) {
-      $markup_value = t('You are masquerading as <a href="@user-url">%masq_as</a>.', array('@user-url' => url('user/' . $user->uid), '%masq_as' => $user->name)) . theme('item_list', $quick_switch_link);
+      $markup_value = t('You are masquerading as <a href="@user-url">%masq_as</a>.', array('@user-url' => url('user/' . $user->uid), '%masq_as' => theme('username', $user->name))) . theme('item_list', $quick_switch_link);
     }
     else {
       $markup_value = t('You are masquerading as %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous'))))  . theme('item_list', $quick_switch_link);
@@ -486,7 +486,7 @@ function masquerade_block_1_validate($form, &$form_state) {
     form_set_error('masquerade_user_field', t('You cannot masquerade as yourself. Please choose a different user to masquerade as.'));
   }
   else if (variable_get('site_offline', 0) && !user_access('administer site configuration', $masq_user)) {
-    form_set_error('masquerade_user_field', t('It is not possible to masquerade in off-line mode as %user does not have the %config-perm permission. Please <a href="@site-maintenance">set the site status</a> to "online" to masquerade as %user.', array('%user' => $masq_user->name, '%config-perm' => 'administer site configuration', '@site-maintenance' => url('admin/settings/site-maintenance'))));
+    form_set_error('masquerade_user_field', t('It is not possible to masquerade in off-line mode as %user does not have the %config-perm permission. Please <a href="@site-maintenance">set the site status</a> to "online" to masquerade as %user.', array('%user' => theme('username', $masq_user->name), '%config-perm' => 'administer site configuration', '@site-maintenance' => url('admin/settings/site-maintenance'))));
   }
   else {
     $form_state['values']['masquerade_user_field'] = $name;
@@ -645,7 +645,7 @@ function masquerade_switch_back_page() {
   global $user;
   $oldname = $user->name;
   masquerade_switch_back();
-  drupal_set_message(t('You are no longer masquerading as %masq_as and are now logged in as %user.', array('%user' => $user->name, '%masq_as' => $oldname)));
+  drupal_set_message(t('You are no longer masquerading as %masq_as and are now logged in as %user.', array('%user' => theme('username', $user->name), '%masq_as' => theme('username', $oldname))));
   drupal_goto(referer_uri());
 }
 
@@ -660,7 +660,6 @@ function masquerade_switch_back() {
   // erase record
   db_query("DELETE FROM {masquerade} WHERE sid = '%s' AND uid_as = %d ", session_id(), $user->uid);
   $oldname = ($user->uid == 0 ? variable_get('anonymous', 'Anonymous') : $user->name);
-  $oldname_themed = theme('username', $user);
   $user = user_load(array('uid' => $uid));
   watchdog('masquerade', 'User %user no longer masquerading as %masq_as.', array('%user' => $user->name, '%masq_as' => $oldname), WATCHDOG_INFO);
 }
