diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 4c67555..7e37c40 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -498,7 +498,9 @@ class CommentInterfaceTest extends CommentHelperCase {
       // Adjust the current/viewing user.
       switch ($case['user']) {
         case 'anonymous':
-          $this->drupalLogout();
+          if ($this->loggedInUser) {
+            $this->drupalLogout();
+          }
           $case['user_uid'] = 0;
           break;
 
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 251c5c1..adf70a7 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1240,8 +1240,7 @@ class DrupalWebTestCase extends DrupalTestCase {
     // Make a request to the logout page, and redirect to the user page, the
     // idea being if you were properly logged out you should be seeing a login
     // screen.
-    $this->drupalGet('user/logout');
-    $this->drupalGet('user');
+    $this->drupalGet('user/logout', array('query' => array('destination' => 'user')));
     $pass = $this->assertField('name', t('Username field found.'), t('Logout'));
     $pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout'));
 
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test
index a7fb8a4..05e3b48 100644
--- a/modules/simpletest/tests/menu.test
+++ b/modules/simpletest/tests/menu.test
@@ -227,11 +227,10 @@ class MenuRouterTestCase extends DrupalWebTestCase {
     variable_set('maintenance_mode', TRUE);
 
     $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')));
-    $this->drupalLogout();
     $this->drupalGet('node');
     $this->assertText($offline_message);
     $this->drupalGet('menu_login_callback');
-    $this->assertText('This is menu_login_callback().', t('Maintenance mode can be bypassed through hook_login_paths().'));
+    $this->assertText('This is menu_login_callback().', t('Maintenance mode can be bypassed through hook_menu_site_status_alter().'));
   }
 
   /**
@@ -239,8 +238,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
    * 'user' and 'user/register' gets redirected to the user edit page.
    */
   function testAuthUserUserLogin() {
-    $loggedInUser = $this->drupalCreateUser(array());
-    $this->drupalLogin($loggedInUser);
+    $web_user = $this->drupalCreateUser(array());
+    $this->drupalLogin($web_user);
 
     $this->DrupalGet('user/login');
     // Check that we got to 'user'.
diff --git a/modules/system/system.test b/modules/system/system.test
index abd21aa..69466c8 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -926,13 +926,8 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
     // Use a custom 403 page.
     $this->drupalPost('admin/config/system/site-information', array('site_403' => 'node/' . $node->nid), t('Save configuration'));
 
-    $this->drupalLogout();
-    $this->drupalGet('admin');
-    $this->assertText($node->title, t('Found the custom 403 page'));
-
     // Logout and check that the user login block is shown on custom 403 pages.
     $this->drupalLogout();
-
     $this->drupalGet('admin');
     $this->assertText($node->title, t('Found the custom 403 page'));
     $this->assertText(t('User login'), t('Blocks are shown on the custom 403 page'));
diff --git a/modules/trigger/trigger.test b/modules/trigger/trigger.test
index 138de62..0aa5435 100644
--- a/modules/trigger/trigger.test
+++ b/modules/trigger/trigger.test
@@ -523,6 +523,7 @@ class TriggerUserActionTestCase extends TriggerActionTestCase {
     // the comment is updated.
     user_save($account, array('status' => TRUE));
 
+    $this->loggedInUser = FALSE;
     $test_user = $this->drupalCreateUser(array('administer actions', 'create article content', 'access comments', 'administer comments', 'skip comment approval', 'edit own comments'));
     $this->drupalLogin($test_user);
 
