diff --git a/core/modules/comment/comment.test b/core/modules/comment/comment.test
index 259e420..da6a747 100644
--- a/core/modules/comment/comment.test
+++ b/core/modules/comment/comment.test
@@ -508,7 +508,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/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php
index 591e8a1..a716683 100644
--- a/core/modules/simpletest/drupal_web_test_case.php
+++ b/core/modules/simpletest/drupal_web_test_case.php
@@ -1265,8 +1265,8 @@ 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')));
+    $this->assertResponse(200, t('User was logged in.'));
     $pass = $this->assertField('name', t('Username field found.'), t('Logout'));
     $pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout'));
 
diff --git a/core/modules/system/tests/menu.test b/core/modules/system/tests/menu.test
index 8d1d651..4753a21 100644
--- a/core/modules/system/tests/menu.test
+++ b/core/modules/system/tests/menu.test
@@ -245,11 +245,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().'));
   }
 
   /**
@@ -257,8 +256,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
    * 'user' and 'user/register' gets redirected to the user edit page.
    */
   function testAuthUserUserLogin() {
-    $this->loggedInUser = $this->drupalCreateUser(array());
-    $this->drupalLogin($this->loggedInUser);
+    $web_user = $this->drupalCreateUser(array());
+    $this->drupalLogin($web_user);
 
     $this->drupalGet('user/login');
     // Check that we got to 'user'.
