How to switch back and logout of masquerade user back to admin? I've setup masquerade module and switched to a regular user, but my switch back to admin block doesn't show up in the main theme and the user has no access to the admin theme. Is there a link I can use to switch myself back to admin?
Looking at the module code, I notice the module defines a block with links for the masquerading operations. If that block is visible for the user account to which you switched, you should see a link to go back to your original account.

This is the code used from the module to show the block.

/**
 * Implements hook_block_view().
 */
function masquerade_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'masquerade':
      if (isset($_SESSION['masquerading']) || (user_access('masquerade as user') || user_access('masquerade as admin'))) {
        $block['subject'] = t('Masquerade');
        $block['content'] = drupal_get_form('masquerade_block_1');
      }
      break;
  }
  return $block;
}

/**
 * Masquerade block form.
 */
function masquerade_block_1() {
  global $user;
  $quick_switch_links = array();
  $markup_value = '';
  if (isset($_SESSION['masquerading'])) {
    $quick_switch_links[] = l(t('Switch back'), 'masquerade/unswitch', array('query' =&gt; array('token' =&gt; drupal_get_token('masquerade/unswitch'))));
    if ($user-&gt;uid &gt; 0) {
      $markup_value = t('You are masquerading as &lt;a href="@user-url"&gt;%masq_as&lt;/a&gt;.', array('@user-url' =&gt; url('user/' . $user-&gt;uid), '%masq_as' =&gt; $user-&gt;name));
    }
    else {
      $markup_value = t('You are masquerading as %anonymous.', array('%anonymous' =&gt; variable_get('anonymous', t('Anonymous'))));
    }
  }
  else {
    $quick_switches = variable_get('masquerade_quick_switches', array());

    // Add in user-specific switches, and prevent duplicates.
    $user_switches = db_query("SELECT uid_to FROM {masquerade_users} WHERE uid_from = :uid_from", array(':uid_from' =&gt; $user-&gt;uid))-&gt;fetchCol();
    $masquerade_switches = array_unique(array_merge($quick_switches, $user_switches));

    foreach ($masquerade_switches as $switch_user) {
      if (!isset($_SESSION['user']-&gt;uid) || $switch_user != $_SESSION['user']-&gt;uid) {
        $account = user_load($switch_user);
        if (isset($account-&gt;uid)) {
          $switch_link = 'masquerade/switch/' . $account-&gt;uid;
          if ($account-&gt;uid) {
            $quick_switch_links[] = l($account-&gt;name, $switch_link, array('query' =&gt; array('token' =&gt; drupal_get_token($switch_link))));
          }
          if ($switch_user == 0) {
            $account-&gt;name = variable_get('anonymous', t('Anonymous'));
            $quick_switch_links[] = l($account-&gt;name, $switch_link, array('query' =&gt; array('token' =&gt; drupal_get_token($switch_link))));
          }
        }
      }
    }

    if (masquerade_menu_access('autocomplete')) {
      $markup_value .= t('Enter the username to masquerade as.');
      $form['masquerade_user_field'] = array(
        '#prefix' =&gt; '&lt;div class="container-inline"&gt;',
        '#type' =&gt; 'textfield',
        '#size' =&gt; '18',
        '#default_value' =&gt; '',
        '#autocomplete_path' =&gt; 'masquerade/autocomplete',
        '#required' =&gt; TRUE,
      );
      $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Go'),
        '#suffix' =&gt; '&lt;/div&gt;',
      );
    }

  }
  if ($quick_switch_links) {
    $markup_value .= '&lt;div id="quick_switch_links"&gt;' . t('Quick switches:') . theme('item_list', array('items' =&gt; $quick_switch_links)) . '&lt;/div&gt;';
  }
  $form['masquerade_desc'] = array(
    '#prefix' =&gt; '&lt;div class="form-item"&gt;&lt;div class="description"&gt;',
    '#markup' =&gt; $markup_value,
    '#suffix' =&gt; '&lt;/div&gt;&lt;/div&gt;',
  );
  return $form;
}


Reading it, I see the same block shows you a Switch back link in the case you are masquerading as another user.
Assuming the block is enabled for all the roles in the site, and it is assigned to a region the currently-set theme uses, one of the reasons for the Switch back link not appearing could be an issue with the user session; in that case isset($_SESSION['masquerading']) could return FALSE.

There is also a bug report about switching back: masquerade/unswitch throws a no acccess error. In that issue is clearly stated you need to use the block to switch back; it also seems there are some issues when the clear URLs aren't enabled.