diff --git a/tests/mollom.test b/tests/mollom.test
index 1dedaaa..a8e3abe 100644
--- a/tests/mollom.test
+++ b/tests/mollom.test
@@ -3611,7 +3611,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
     $mid = $this->assertTestSubmitData();
     $data = $this->assertMollomData('mollom_test', $mid);
     $record = mollom_test_load($mid);
-    $this->assertEqual($record['status'], 0, t('Unpublished test post found.'));
+    $this->assertEqual($record->status, 0, t('Unpublished test post found.'));
     $this->assertSame('spamScore', $data->spamScore, 0.5);
     $this->assertSame('spamClassification', $data->spamClassification, 'unsure');
     $this->assertSame('moderate', $data->moderate, 1);
@@ -3626,7 +3626,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
     $mid = $this->assertTestSubmitData($mid);
     $data = $this->assertMollomData('mollom_test', $mid);
     $record = mollom_test_load($mid);
-    $this->assertEqual($record['status'], 0, t('Unpublished test post found.'));
+    $this->assertEqual($record->status, 0, t('Unpublished test post found.'));
     $this->assertSame('spamScore', $data->spamScore, 0.5);
     $this->assertSame('spamClassification', $data->spamClassification, 'unsure');
     $this->assertSame('moderate', $data->moderate, 1);
@@ -3640,7 +3640,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
     $mid = $this->assertTestSubmitData($mid);
     $data = $this->assertMollomData('mollom_test', $mid);
     $record = mollom_test_load($mid);
-    $this->assertEqual($record['status'], 1, t('Published test post found.'));
+    $this->assertEqual($record->status, 1, t('Published test post found.'));
     $this->assertSame('spamScore', $data->spamScore, 0.5);
     $this->assertSame('spamClassification', $data->spamClassification, 'unsure');
     $this->assertSame('moderate', $data->moderate, 0);
@@ -3673,7 +3673,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
     $mid = $this->assertTestSubmitData();
     $data = $this->assertMollomData('mollom_test', $mid);
     $record = mollom_test_load($mid);
-    $this->assertEqual($record['status'], 0, t('Unpublished test post found.'));
+    $this->assertEqual($record->status, 0, t('Unpublished test post found.'));
     $this->assertSame('spamScore', $data->spamScore, 1.0);
     $this->assertSame('spamClassification', $data->spamClassification, 'spam');
     $this->assertSame('profanityScore', $data->profanityScore, 1);
@@ -3689,7 +3689,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
     $mid = $this->assertTestSubmitData($mid);
     $data = $this->assertMollomData('mollom_test', $mid);
     $record = mollom_test_load($mid);
-    $this->assertEqual($record['status'], 0, t('Unpublished test post found.'));
+    $this->assertEqual($record->status, 0, t('Unpublished test post found.'));
     $this->assertSame('spamScore', $data->spamScore, 1.0);
     $this->assertSame('spamClassification', $data->spamClassification, 'spam');
     $this->assertSame('profanityScore', $data->profanityScore, 1);
@@ -3704,7 +3704,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
     $mid = $this->assertTestSubmitData($mid);
     $data = $this->assertMollomData('mollom_test', $mid);
     $record = mollom_test_load($mid);
-    $this->assertEqual($record['status'], 1, t('Published test post found.'));
+    $this->assertEqual($record->status, 1, t('Published test post found.'));
     $this->assertSame('spamScore', $data->spamScore, 1.0);
     $this->assertSame('spamClassification', $data->spamClassification, 'spam');
     $this->assertSame('profanityScore', $data->profanityScore, 1);
@@ -3730,7 +3730,7 @@ class MollomAnalysisTestCase extends MollomWebTestCase {
       $mid = $this->assertTestSubmitData();
       $data = $this->assertMollomData('mollom_test', $mid);
       $record = mollom_test_load($mid);
-      $this->assertEqual($record['status'], 1, t('Published test post %body found.', array('%body' => $body)));
+      $this->assertEqual($record->status, 1, t('Published test post %body found.', array('%body' => $body)));
       $this->assertSame('spamScore', $data->spamScore, $expected['spamScore']);
       $this->assertSame('spamClassification', $data->spamClassification, $expected['spamClassification']);
       $this->assertSame('profanityScore', $data->profanityScore, $expected['profanityScore']);
@@ -4139,7 +4139,7 @@ class MollomModerationIntegrationTestCase extends MollomWebTestCase {
     $this->assertText('Successful form submission');
     $mid = $this->getFieldValueByName('mid');
     $record = mollom_test_load($mid);
-    $this->assertSame('Publishing status', $record['status'], 0);
+    $this->assertSame('Publishing status', $record->status, 0);
     $data = mollom_data_load('mollom_test', $mid);
     $this->assertTrue($data, 'Mollom data for post exists.');
     return $data;
@@ -4268,7 +4268,7 @@ class MollomModerationIntegrationTestCase extends MollomWebTestCase {
     $this->assertMollomWatchdogMessages(WATCHDOG_WARNING);
     $this->assertResponse(403);
     $record = mollom_test_load($data->id);
-    $this->assertTrue(!empty($record) && $record['status'] == 0, 'Test post still exists.');
+    $this->assertTrue(!empty($record) && $record->status == 0, 'Test post still exists.');
 
     $this->setProtection('mollom_test_form', MOLLOM_MODE_ANALYSIS, NULL, array(
       'mollom[moderation]' => 1,
@@ -4323,7 +4323,7 @@ class MollomModerationIntegrationTestCase extends MollomWebTestCase {
       $this->assertMollomWatchdogMessages($test['watchdog']);
       $this->assertResponse(403);
       $record = mollom_test_load($data->id);
-      $this->assertTrue(!empty($record) && $record['status'] == 0, 'Test post still exists.');
+      $this->assertTrue(!empty($record) && $record->status == 0, 'Test post still exists.');
 
       // Restore original properties on Mollom client.
       foreach ($test['class'] as $key => $value) {
@@ -4354,7 +4354,7 @@ class MollomModerationIntegrationTestCase extends MollomWebTestCase {
       if ($action == 'approve') {
         $this->assertMollomWatchdogMessages();
         $this->assertResponse(200);
-        $this->assertSame('Publishing status', $record['status'], 1);
+        $this->assertSame('Publishing status', $record->status, 1);
         $this->assertTrue($new_data, 'Mollom data for approved post still exists.');
         $this->assertFalse($new_data->moderate, 'Post is flagged as moderated.');
       }
@@ -4369,7 +4369,7 @@ class MollomModerationIntegrationTestCase extends MollomWebTestCase {
       else {
         $this->assertMollomWatchdogMessages(WATCHDOG_WARNING);
         $this->assertResponse(404);
-        $this->assertTrue(!empty($record) && $record['status'] == 0, 'Test post still exists.');
+        $this->assertTrue(!empty($record) && $record->status == 0, 'Test post still exists.');
         $this->assertTrue($new_data->moderate, 'Post is not flagged as moderated.');
       }
     }
diff --git a/tests/mollom_test.module b/tests/mollom_test.module
index 395ce28..2954ff1 100644
--- a/tests/mollom_test.module
+++ b/tests/mollom_test.module
@@ -98,7 +98,7 @@ function mollom_test_form(&$form_state, $mid = NULL) {
     $form_state['storage'] = array();
   }
   if (isset($mid) && ($record = mollom_test_load($mid))) {
-    $form_state['storage'] = $record;
+    $form_state['storage'] = (array) $record;
   }
   $form_state['storage'] += array(
     'mid' => $mid,
@@ -245,7 +245,7 @@ function mollom_mollom_test_presave($record) {
  * Loads a {mollom_test} data record by id.
  */
 function mollom_test_load($mid) {
-  return db_fetch_array(db_query('SELECT * FROM {mollom_test} WHERE mid = %d', array($mid)));
+  return db_fetch_object(db_query('SELECT * FROM {mollom_test} WHERE mid = %d', array($mid)));
 }
 
 /**
@@ -279,9 +279,7 @@ function mollom_test_save($record) {
  */
 function mollom_test_delete_multiple(array $mids) {
   foreach ($mids as $mid) {
-    // @todo The core entity system expects objects.
-    $record = (object) mollom_test_load($mid);
-    if ($record) {
+    if ($record = mollom_test_load($mid)) {
       module_invoke_all('entity_delete', $record, 'mollom_test');
     }
   }
@@ -301,10 +299,10 @@ function mollom_test_entity_delete($entity, $type) {
  * Form constructor for deleting a Mollom test item.
  */
 function mollom_test_delete_form(&$form_state, $record) {
-  $form['mid'] = array('#type' => 'value', '#value' => $record['mid']);
+  $form['mid'] = array('#type' => 'value', '#value' => $record->mid);
   return confirm_form($form,
-    t('Are you sure you want to delete the %title?', array('%title' => $record['title'])),
-    'mollom-test/form/' . $record['mid'],
+    t('Are you sure you want to delete the %title?', array('%title' => $record->title)),
+    'mollom-test/form/' . $record->mid,
     NULL,
     t('Delete')
   );
