diff --git a/plugins/views_plugin_display_block.inc b/plugins/views_plugin_display_block.inc
index c016a27..d8889f3 100644
--- a/plugins/views_plugin_display_block.inc
+++ b/plugins/views_plugin_display_block.inc
@@ -160,13 +160,16 @@ class views_plugin_display_block extends views_plugin_display {
   function options_submit(&$form, &$form_state) {
     // It is very important to call the parent function here:
     parent::options_submit($form, $form_state);
+    $section = $form_state['section'];
     switch ($form_state['section']) {
+      case 'display_id':
+        $this->save_block_bid($this->display->id, $this->display->new_id);
       case 'block_description':
         $this->set_option('block_description', $form_state['values']['block_description']);
         break;
       case 'block_caching':
         $this->set_option('block_caching', $form_state['values']['block_caching']);
-        $this->save_block_cache($form_state['view']->name.'-'.$form_state['display_id'], $form_state['values']['block_caching']);
+        $this->save_block_cache($form_state['view']->name . '-'. $form_state['display_id'], $form_state['values']['block_caching']);
         break;
     }
   }
@@ -183,6 +186,23 @@ class views_plugin_display_block extends views_plugin_display {
   }
 
   /**
+   * Update the block bid when you change the machine readable name of the display.
+   */
+  function save_block_bid($old_delta, $delta) {
+    $old_delta = $form_state['view']->name . '-' . $old_delta;
+    $delta = $form_state['view']->name . '-' . $delta;
+    if (strlen($old_delta) >= 32) {
+      $old_delta = md5($old_delta);
+    }
+    if (strlen($delta) >= 32) {
+      $delta = md5($delta);
+    }
+    db_update('block')
+      ->fields(array('bid' => $delta))
+      ->condition('bid', $old_delta)
+      ->execute();
+  }
+  /**
    * Save the block cache setting in the blocks table if this block allready
    * exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in.
    */
