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 42bab12..38022ff 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1240,8 +1240,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 out.'));
     $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'.
