diff --git a/bean.install b/bean.install
index ae629b2..634cc83 100644
--- a/bean.install
+++ b/bean.install
@@ -20,7 +20,7 @@ function bean_schema() {
       'delta' => array(
         'description' => "The bean's {block}.delta.",
         'type' => 'varchar',
-        'length' => 32,
+        'length' => 255,
         'not null' => TRUE,
       ),
       'label' => array(
@@ -176,3 +176,42 @@ function bean_update_7006() {
   registry_rebuild();
   return t('Registry and Menu have been rebuilt');
 }
+
+/**
+ * Update maximum allowed size of {Bean}.delta field values
+ */
+function bean_update_7007() {
+  $spec = array(
+    'description' => "The bean's {block}.delta.",
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+  );
+  db_drop_unique_key('bean', 'delta');
+  db_change_field('bean', 'delta', 'delta', $spec, array('unique key' => array('delta' => array('delta'))));
+  return t('Updated maximum allowed size of {Bean}.delta field values');
+}
+
+/**
+ * Rewrite bean deltas as lowercase with underscores (instead of dashes).
+ */
+function bean_update_7008() {
+  $deltas = db_select('bean', 'b')
+              ->fields('b', array('delta'))
+              ->execute()
+              ->fetchAllAssoc('delta');
+  $count = 0;
+  foreach($deltas as $delta => $data) {
+    $query = db_update('bean')
+               ->fields(array('delta' => str_replace('-', '_', $delta)))
+               ->condition('delta', $delta, '=')
+               ->execute();
+    $query = db_update('block')
+               ->fields(array('delta' => str_replace('-', '_', $delta)))
+               ->condition('delta', $delta, '=')
+               ->condition('module', 'bean', '=')
+               ->execute();
+    $count++;
+  }
+  return format_plural($count, 'Updated <em>1</em> Bean Delta', 'Updated @count Bean Deltas');
+}
diff --git a/bean.module b/bean.module
index be52036..19e3f04 100644
--- a/bean.module
+++ b/bean.module
@@ -486,6 +486,10 @@ function bean_permission() {
       'title' => t('Change the View Mode of the Bean'),
       'description' => t('Ability to change the view mode on the bean form'),
     ),
+    'edit bean machine name' => array(
+      'title'       => t('Change the machine name of a Bean'),
+      'description' => t('Ability to change the machine name on the bean form'),
+    ),
   );
 
   // Add a Permission for each entity type.
diff --git a/bean_admin_ui/bean_admin_ui.admin.inc b/bean_admin_ui/bean_admin_ui.admin.inc
index 2722e7e..7c81a4c 100644
--- a/bean_admin_ui/bean_admin_ui.admin.inc
+++ b/bean_admin_ui/bean_admin_ui.admin.inc
@@ -104,19 +104,11 @@ function bean_admin_ui_type_form($form, &$form_state, $bean_type = NULL) {
     '#disabled' => $disabled,
   );
 
-  $form['description'] = array(
-    '#title' => t('Description'),
-    '#type' => 'textarea',
-    '#default_value' => $bean_type->getDescription(),
-    '#description' => t('The description of this block type.'),
-    '#disabled' => $disabled,
-  );
-
   // Machine-readable type name.
   $form['name'] = array(
     '#type' => 'machine_name',
     '#default_value' => isset($bean_type->type) ? $bean_type->type : '',
-    '#maxlength' => 32,
+    '#maxlength' => 255,
     '#machine_name' => array(
       'exists' => 'bean_type_load',
       'source' => array('label'),
@@ -125,6 +117,14 @@ function bean_admin_ui_type_form($form, &$form_state, $bean_type = NULL) {
     '#disabled' => $disabled,
   );
 
+  $form['description'] = array(
+    '#title' => t('Description'),
+    '#type' => 'textarea',
+    '#default_value' => $bean_type->getDescription(),
+    '#description' => t('The description of this block type.'),
+    '#disabled' => $disabled,
+  );
+
   $form['actions'] = array('#type' => 'actions');
   $form['actions']['submit'] = array(
     '#type' => 'submit',
diff --git a/includes/bean.core.inc b/includes/bean.core.inc
index 260d03e..dde4be0 100644
--- a/includes/bean.core.inc
+++ b/includes/bean.core.inc
@@ -288,6 +288,14 @@ class Bean extends Entity {
     }
   }
 
+  public function changeDelta($original, $values) {
+    $this->delta = str_replace('-', '_', drupal_clean_css_identifier($values['machine_name']));
+    db_update('bean')
+      ->fields(array('delta' => $this->delta))
+      ->condition('delta', $original, '=')
+      ->execute();
+  }
+
   /**
    * Generate an array for rendering the entity.
    *
@@ -307,15 +315,15 @@ class Bean extends Entity {
   public function save() {
     // Set the delta if it's not set already
     if (empty($this->delta)) {
-      $max_length = 32;
+      $max_length = 255;
       // Base it on the label and make sure it isn't too long for the database.
-      $this->delta = drupal_clean_css_identifier(strtolower($this->label));
+      $this->delta = str_replace('-', '_', drupal_clean_css_identifier(strtolower($this->label)));
       $this->delta = substr($this->delta, 0, $max_length);
 
       // Check if delta is unique.
       if (bean_load_delta($this->delta)) {
         $i = 0;
-        $separator = '-';
+        $separator = '_';
         $original_delta = $this->delta;
         do {
           $unique_suffix = $separator . $i++;
diff --git a/includes/bean.pages.inc b/includes/bean.pages.inc
index 53c7ac2..9841cc3 100644
--- a/includes/bean.pages.inc
+++ b/includes/bean.pages.inc
@@ -181,12 +181,28 @@ function bean_form($form, &$form_state, Bean $bean, $type = NULL) {
     '#weight' => -10,
   );
 
+  if (user_access('edit bean machine name')) {
+    $form['machine_name'] = array(
+      '#type'  => 'machine_name',
+      '#title' => t('Machine Name'),
+      '#machine_name' => array(
+        'exists' => 'bean_load_delta',
+        'source' => array('label'),
+        'replace' => '_',
+      ),
+      '#description' => t('A unique machine-readable name for this block type. It must only contain lowercase letters, numbers, and underscores.'),
+      '#default_value' => isset($bean->delta) ? $bean->delta : '',
+      '#maxlength' => 255,
+      '#weight' => -9,
+    );
+  }
+
   $form['title'] = array(
     '#type' => 'textfield',
     '#title' => t('Title'),
     '#description' => t('The Title of the block.'),
     '#default_value' => $bean->title,
-    '#weight' => -9,
+    '#weight' => -8,
   );
 
   // The view mode.
@@ -202,7 +218,7 @@ function bean_form($form, &$form_state, Bean $bean, $type = NULL) {
       '#type' => 'select',
       '#required' => TRUE,
       '#options' => $view_modes,
-      '#weight' => -8,
+      '#weight' => -7,
     );
   }
   else {
@@ -269,6 +285,15 @@ function bean_form_submit($form, &$form_state) {
   $bean = bean_form_submit_build_bean($form, $form_state);
   $bean->setValues($form_state['values']);
   $insert = $bean->internalIdentifier();
+  if (!empty($insert)) {
+    if (isset($form_state['values']['bean']->delta)) {
+      if (isset($form_state['values']['machine_name']) 
+          && $form_state['values']['machine_name'] != $form_state['values']['bean']->delta) {
+        $original_delta = $form_state['values']['bean']->delta;
+        $bean->changeDelta($original_delta, $form_state['values']);
+      }
+    }
+  }
   field_attach_submit('bean', $bean, $form, $form_state);
   $bean->save();
 
