diff --git a/includes/batch.inc b/includes/batch.inc
index 13e8500..5e3fa9c 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -8,13 +8,9 @@
  * State-based dispatcher for the batch processing page.
  */
 function _batch_page() {
-  $batch =& batch_get();
+  $batch = _batch_load();

-  // Retrieve the current state of batch from db.
-  if (isset($_REQUEST['id']) && $data = db_result(db_query("SELECT batch FROM {batch} WHERE bid = %d AND token = '%s'", $_REQUEST['id'], drupal_get_token($_REQUEST['id'])))) {
-    $batch = unserialize($data);
-  }
-  else {
+  if (empty($batch)) {
     return FALSE;
   }

@@ -47,6 +43,27 @@ function _batch_page() {
 }

 /**
+ * Load the batch into the static batch array.
+ *
+ * @return array
+ */
+function _batch_load() {
+  $batch =& batch_get();
+
+  // If the batch has already been loaded.
+  if (!empty($batch)) {
+    return $batch;
+  }
+
+  // Retrieve the current state of batch from db.
+  if (isset($_REQUEST['id']) && $data = db_result(db_query('SELECT batch FROM {batch} WHERE bid = %d AND token = "%s"', $_REQUEST['id'], drupal_get_token($_REQUEST['id'])))) {
+    $batch = unserialize($data);
+  }
+
+  return $batch;
+}
+
+/**
  * Initiate the batch processing
  */
 function _batch_start() {
diff --git a/includes/form.inc b/includes/form.inc
index 1529c19..974b015 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2479,6 +2479,7 @@ function batch_set($batch_definition) {
       $batch['sets'] = array_merge($slice1, array($batch_set), $slice2);
     }
     else {
+      $batch_set = module_invoke_all('batch_alter', $batch_set);
       $batch['sets'][] = $batch_set;
     }
   }

