diff --git a/modules/block/block.module b/modules/block/block.module
index 2977ca8..06be200 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -447,15 +447,11 @@ function _block_rehash($theme = NULL) {
         $block['status'] = 0;
         $block['region'] = BLOCK_REGION_NONE;
       }
-      // There is no point saving disabled blocks. Still, we need to save them
-      // because the 'title' attribute is saved to the {blocks} table.
       if (isset($block['bid'])) {
         // If the block has a bid property, it comes from the database and
         // the record needs to be updated, so set the primary key to 'bid'
         // before passing to drupal_write_record().
         $primary_keys = array('bid');
-        // Remove a block from the list of blocks to keep if it became disabled.
-        unset($bids[$block['bid']]);
       }
       else {
         $primary_keys = array();
@@ -468,13 +464,14 @@ function _block_rehash($theme = NULL) {
         drupal_write_record('block', $block, $primary_keys);
         // Make it possible to test this.
         $block['saved'] = TRUE;
+        $bids[$block['bid']] = $block['bid'];
       }
       // Add to the list of blocks we return.
       $blocks[] = $block;
     }
   }
   if ($bids) {
-    // Remove disabled that are no longer defined by the code from the
+    // Remove disabled blocks no longer defined by their modules from the
     // database.
     db_delete('block')
       ->condition('bid', $bids, 'NOT IN')
