diff --git a/includes/mollom.class.inc b/includes/mollom.class.inc
index e8a65e1..d192427 100644
--- a/includes/mollom.class.inc
+++ b/includes/mollom.class.inc
@@ -506,8 +506,14 @@ abstract class Mollom {
         $response->data = json_decode($response->body, TRUE);
       }
       elseif (strstr($response->headers['content-type'], 'application/xml')) {
-        $response->elements = new SimpleXmlIterator($response->body);
-        $response->data = $this->parseXML($response->elements);
+        try {
+          $response->elements = new SimpleXmlIterator($response->body);
+          $response->data = $this->parseXML($response->elements);
+        }
+        catch (Exception $e) {
+          // Invalid XML so just set the data back to blank.
+          $response->data = array();
+        }
       }
     }
 
diff --git a/mollom.admin.inc b/mollom.admin.inc
index a9b4f09..160e76c 100644
--- a/mollom.admin.inc
+++ b/mollom.admin.inc
@@ -866,7 +866,7 @@ function mollom_admin_settings($form, &$form_state) {
     )),
     '#collapsible' => TRUE,
     // Only show key configuration fields if they are not configured or invalid.
-    '#collapsed' => $status['isVerified'],
+    '#collapsed' => !$status['isVerified'],
   );
   // Keys are not #required to allow to install this module and configure it
   // later.
diff --git a/mollom.drupal.inc b/mollom.drupal.inc
index 6b9d17d..382f032 100644
--- a/mollom.drupal.inc
+++ b/mollom.drupal.inc
@@ -17,6 +17,11 @@ class MollomDrupal extends Mollom {
    */
   public function __construct() {
     parent::__construct();
+    // Set any configured endpoint that may be different from the default.
+    $configured_server = $this->loadConfiguration('server');
+    if (!empty($configured_server)) {
+      $this->server = $configured_server;
+    }
     $this->requestTimeout = variable_get('mollom_connection_timeout', 3);
   }
 
@@ -29,6 +34,7 @@ class MollomDrupal extends Mollom {
     'publicKey' => 'mollom_public_key',
     'privateKey' => 'mollom_private_key',
     'expectedLanguages' => 'mollom_languages_expected',
+    'server' => 'mollom_api_endpoint',
   );
 
   /**
@@ -43,6 +49,11 @@ class MollomDrupal extends Mollom {
    * Implements Mollom::saveConfiguration().
    */
   public function saveConfiguration($name, $value) {
+    // Set local variable.
+    if (property_exists('MollomDrupal', $name)) {
+      $this->{$name} = $value;
+    }
+    // Persist in Drupal.
     $name = $this->configuration_map[$name];
     return variable_set($name, $value);
   }
@@ -223,6 +234,7 @@ class MollomDrupalTest extends MollomDrupal {
       // Do not destroy production variables when testing mode is enabled.
       $this->configuration_map['publicKey'] = 'mollom_test_public_key';
       $this->configuration_map['privateKey'] = 'mollom_test_private_key';
+      $this->configuration_map['server'] = 'mollom_test_api_endpoint';
     }
 
     // Load and set publicKey and privateKey configuration values.
@@ -414,8 +426,10 @@ class MollomDrupalTestInvalid extends MollomDrupalTest {
    */
   function __construct() {
     $this->originalServer = $this->server;
-    $this->server = 'fake-host';
+    $this->configuration_map['server'] = 'mollom_test_invalid_api_endpoint';
     parent::__construct();
+
+    $this->saveConfiguration('server', 'fake-host');
   }
 
   /**
diff --git a/tests/mollom.test b/tests/mollom.test
index d9aaacd..400e516 100644
--- a/tests/mollom.test
+++ b/tests/mollom.test
@@ -1173,6 +1173,12 @@ class MollomInstallationTestCase extends MollomWebTestCase {
    * Note: Partial error messages tested here; hence, no t().
    */
   function testInstallationProcess() {
+    $message_invalid = t('The Mollom servers could be contacted, but Mollom API keys could not be verified.');
+    $message_valid = t('The services are operating correctly.');
+    $message_missing = t('The Mollom API keys are not configured yet.');
+    $message_server = t('The Mollom servers could not be contacted. Please make sure that your web server can make outgoing HTTP requests.');
+    $message_saved = t('The configuration options have been saved.');
+
     $admin_message = t('Visit the <a href="@settings-url">Mollom settings page</a> to configure your keys.', array(
       '@settings-url' => url('admin/config/content/mollom/settings'),
     ));
@@ -1205,8 +1211,8 @@ class MollomInstallationTestCase extends MollomWebTestCase {
 
     // Verify presence of 'empty keys' error message.
     $this->drupalGet('admin/config/content/mollom');
-    $this->assertText('The Mollom API keys are not configured yet.');
-    $this->assertNoText('The configured Mollom API keys are invalid.');
+    $this->assertText($message_missing);
+    $this->assertNoText($message_invalid);
 
     // Verify requirements error about missing API keys.
     $this->drupalGet('admin/reports/status');
@@ -1221,36 +1227,36 @@ class MollomInstallationTestCase extends MollomWebTestCase {
     );
     $this->drupalGet('admin/config/content/mollom/settings');
     $this->drupalPost(NULL, $edit, t('Save configuration'), array('watchdog' => WATCHDOG_EMERGENCY));
-    $this->assertText(t('The configuration options have been saved.'));
+    $this->assertText($message_saved);
     $this->assertNoText($this->fallback_message, t('Fallback message not found.'));
 
     // Verify presence of 'incorrect keys' error message.
-    $this->assertText('The configured Mollom API keys are invalid.');
-    $this->assertNoText('The Mollom API keys are not configured yet.');
-    $this->assertNoText(t('The Mollom servers could not be contacted. Please make sure that your web server can make outgoing HTTP requests.'));
+    $this->assertText($message_invalid);
+    $this->assertNoText($message_missing);
+    $this->assertNoText($message_server);
 
     // Verify requirements error about invalid API keys.
     $this->drupalGet('admin/reports/status', array('watchdog' => WATCHDOG_EMERGENCY));
-    $this->assertText('The configured Mollom API keys are invalid.');
+    $this->assertText($message_invalid);
 
     // Ensure unreachable servers.
     variable_set('mollom_class', 'MollomDrupalTestInvalid');
 
     // Verify presence of 'network error' message.
     $this->drupalGet('admin/config/content/mollom/settings', array('watchdog' => WATCHDOG_EMERGENCY));
-    $this->assertText(t('The Mollom servers could not be contacted. Please make sure that your web server can make outgoing HTTP requests.'));
-    $this->assertNoText('The Mollom API keys are not configured yet.');
-    $this->assertNoText('The configured Mollom API keys are invalid.');
+    $this->assertText($message_server);
+    $this->assertNoText($message_missing);
+    $this->assertNoText($message_invalid);
 
     // Verify requirements error about network error.
     $this->drupalGet('admin/reports/status', array('watchdog' => WATCHDOG_EMERGENCY));
-    $this->assertText(t('The Mollom servers could not be contacted. Please make sure that your web server can make outgoing HTTP requests.'));
+    $this->assertText($message_server);
     $this->assertNoText($this->fallback_message, t('Fallback message not found.'));
 
     // Create a testing site on backend to have some API keys.
+    variable_set('mollom_class', $this->mollomClass);
     $this->getClient();
     $this->mollom->createKeys();
-    variable_set('mollom_class', $this->mollomClass);
 
     // Verify that valid keys work.
     $this->drupalGet('admin/config/content/mollom/settings', array('watchdog' => WATCHDOG_EMERGENCY));
@@ -1260,23 +1266,23 @@ class MollomInstallationTestCase extends MollomWebTestCase {
       'mollom_private_key' => $this->mollom->privateKey,
     );
     $this->drupalPost(NULL, $edit, t('Save configuration'));
-    $this->assertText(t('The configuration options have been saved.'));
-    $this->assertText('The services are operating correctly.');
-    $this->assertNoText('The Mollom API keys are not configured yet.');
-    $this->assertNoText('The configured Mollom API keys are invalid.');
+    $this->assertText($message_saved);
+    $this->assertText($message_valid);
+    $this->assertNoText($message_missing);
+    $this->assertNoText($message_invalid);
 
     // Verify that deleting keys throws the correct error message again.
     $this->drupalGet('admin/config/content/mollom/settings');
-    $this->assertText('The services are operating correctly.');
+    $this->assertText($message_valid);
     $edit = array(
       'mollom_public_key' => '',
       'mollom_private_key' => '',
     );
-    $this->drupalPost(NULL, $edit, t('Save configuration'));
-    $this->assertText(t('The configuration options have been saved.'));
-    $this->assertNoText('The services are operating correctly.');
-    $this->assertText('The Mollom API keys are not configured yet.');
-    $this->assertNoText('The configured Mollom API keys are invalid.');
+    $this->drupalPost(NULL, $edit, t('Save configuration'), array('watchdog' => WATCHDOG_EMERGENCY));
+    $this->assertText($message_saved);
+    $this->assertNoText($message_valid);
+    $this->assertText($message_missing);
+    $this->assertNoText($message_invalid);
   }
 }
 
