diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 6370033..dea6b36 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -660,7 +660,7 @@ protected function changeDatabasePrefix() {
     Database::renameConnection('default', 'simpletest_original_default');
     foreach ($connection_info as $target => $value) {
       $connection_info[$target]['prefix'] = array(
-        'default' => $value['prefix']['default'] . $this->databasePrefix,
+        'default' => $this->databasePrefix,
       );
     }
     Database::addConnectionInfo('default', 'default', $connection_info['default']);
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index d814326..e06ebbd 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
@@ -135,10 +135,13 @@ function testUserAgentValidation() {
    * that the results are displayed correctly.
    */
   function testWebTestRunner() {
+    global $base_url;
     $this->pass = t('SimpleTest pass.');
     $this->fail = t('SimpleTest fail.');
     $this->valid_permission = 'access content';
     $this->invalid_permission = 'invalid permission';
+    $this->label = 'Erroneous Link';
+    $this->url_before = $base_url . '/node';
 
     if ($this->inCURL()) {
       // Only run following code if this test is running itself through a CURL request.
@@ -188,6 +191,10 @@ function stubTest() {
     array_key_exists(NULL, NULL);
 
     debug('Foo', 'Debug');
+
+    // Click a link that doesn't exist.
+    $this->drupalGet('node');
+    $this->clickLink('Erroneous Link');
   }
 
   /**
@@ -222,7 +229,10 @@ function confirmStubTestResults() {
 
     $this->assertAssertion("Debug: 'Foo'", 'Debug', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
 
-    $this->assertEqual('6 passes, 5 fails, 2 exceptions, and 1 debug message', $this->childTestResults['summary'], 'Stub test summary is correct');
+    //Check that we make click in a link that doesn't exist.
+    $this->assertAssertion(format_string('Clicked link %label () from @url_before', array('%label' => $this->label, '@url_before' => $this->url_before)), 'Browser', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()');
+
+    $this->assertEqual('10 passes, 6 fails, 2 exceptions, and 3 debug messages', $this->childTestResults['summary'], 'Stub test summary is correct');
 
     $this->test_ids[] = $test_id = $this->getTestIdFromResults();
     $this->assertTrue($test_id, t('Found test ID in results.'));
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 4d86f8d..4bc0f1a 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -1829,11 +1829,9 @@ protected function clickLink($label, $index = 0) {
     $url_before = $this->getUrl();
     $urls = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
 
-    if (isset($urls[$index])) {
-      $url_target = $this->getAbsoluteUrl($urls[$index]['href']);
-    }
+    $url_target = isset($urls[$index]) ? $this->getAbsoluteUrl($urls[$index]['href']) : '';
 
-    $this->assertTrue(isset($urls[$index]), t('Clicked link %label (@url_target) from @url_before', array('%label' => $label, '@url_target' => $url_target, '@url_before' => $url_before)), t('Browser'));
+    $this->assertTrue(isset($urls[$index]), format_string('Clicked link %label (@url_target) from @url_before', array('%label' => $label, '@url_target' => $url_target, '@url_before' => $url_before)), t('Browser'));
 
     if (isset($url_target)) {
       return $this->drupalGet($url_target);
