diff --git a/uc_order/lib/Drupal/uc_order/Form/OrderWorkflowForm.php b/uc_order/lib/Drupal/uc_order/Form/OrderWorkflowForm.php
index c5c5708..e5942ee 100644
--- a/uc_order/lib/Drupal/uc_order/Form/OrderWorkflowForm.php
+++ b/uc_order/lib/Drupal/uc_order/Form/OrderWorkflowForm.php
@@ -68,8 +68,10 @@ class OrderWorkflowForm extends FormBase {
       '#type' => 'details',
       '#title' => t('Order statuses'),
       '#collapsible' => FALSE,
-      '#theme' => 'uc_order_status_table',
-      '#tree' => TRUE,
+    );
+    $form['order_statuses']['order_statuses'] = array(
+      '#type' => 'table',
+      '#header' => array(t('ID'), t('Title'), t('List position'), t('State'), t('Remove')),
     );
 
     // Build the state option array for the order status table.
@@ -79,36 +81,34 @@ class OrderWorkflowForm extends FormBase {
     }
 
     foreach ($statuses as $status) {
-      $form['order_statuses'][$status['id']]['id'] = array(
+      $form['#locked'][$status['id']] = $status['locked'];
+
+      $form['order_statuses']['order_statuses'][$status['id']]['id'] = array(
         '#markup' => $status['id'],
       );
-      $form['order_statuses'][$status['id']]['title'] = array(
+      $form['order_statuses']['order_statuses'][$status['id']]['title'] = array(
         '#type' => 'textfield',
         '#default_value' => $status['title'],
         '#size' => 32,
         '#required' => TRUE,
       );
-      $form['order_statuses'][$status['id']]['weight'] = array(
+      $form['order_statuses']['order_statuses'][$status['id']]['weight'] = array(
         '#type' => 'weight',
         '#delta' => 20,
         '#default_value' => $status['weight'],
       );
-      $form['order_statuses'][$status['id']]['locked'] = array(
-        '#type' => 'value',
-        '#value' => $status['locked'],
-      );
       if ($status['locked']) {
-        $form['order_statuses'][$status['id']]['state'] = array(
+        $form['order_statuses']['order_statuses'][$status['id']]['state'] = array(
           '#markup' => $states[$status['state']]['title'],
         );
       }
       else {
-        $form['order_statuses'][$status['id']]['state'] = array(
+        $form['order_statuses']['order_statuses'][$status['id']]['state'] = array(
           '#type' => 'select',
           '#options' => $options,
           '#default_value' => $status['state'],
         );
-        $form['order_statuses'][$status['id']]['remove'] = array(
+        $form['order_statuses']['order_statuses'][$status['id']]['remove'] = array(
           '#type' => 'checkbox',
         );
       }
@@ -132,7 +132,7 @@ class OrderWorkflowForm extends FormBase {
     }
 
     foreach ($form_state['values']['order_statuses'] as $key => $value) {
-      if ($value['locked'] != TRUE && $value['remove'] == TRUE) {
+      if (!$form['#locked'][$key] && $value['remove']) {
         db_delete('uc_order_statuses')
           ->condition('order_status_id', $key)
           ->execute();
@@ -145,7 +145,7 @@ class OrderWorkflowForm extends FormBase {
         );
 
         // The state cannot be changed if the status is locked.
-        if ($value['locked'] == FALSE) {
+        if (!$form['#locked'][$key]) {
           $fields['state'] = $value['state'];
         }
 
diff --git a/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php b/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php
index ce51721..38e777e 100644
--- a/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php
+++ b/uc_order/lib/Drupal/uc_order/Tests/OrderTest.php
@@ -140,6 +140,44 @@ class OrderTest extends UbercartTestBase {
     $this->assertFieldByName('bill_to[last_name]', $edit['bill_to[last_name]'], 'Billing last name changed.');
   }
 
+  public function testCustomOrderStatus() {
+    $order = $this->ucCreateOrder($this->customer);
+
+    $this->drupalLogin($this->adminUser);
+
+    // Update an order status label.
+    $this->drupalGet('admin/store/settings/orders');
+    $title = $this->randomName();
+    $edit = array(
+      'order_statuses[in_checkout][title]' => $title,
+    );
+    $this->drupalPostForm(NULL, $edit, 'Submit changes');
+    $this->assertFieldByName('order_statuses[in_checkout][title]', $title, 'Updated status title found.');
+
+    // Confirm the updated label is displayed.
+    $this->drupalGet('admin/store/orders/view');
+    $this->assertText($title, 'Order displays updated status title.');
+
+    // Create a custom order status.
+    $this->drupalGet('admin/store/settings/orders');
+    $this->clickLink('Create custom order status');
+    $edit = array(
+      'status_id' => strtolower($this->randomName()),
+      'status_title' => $this->randomName(),
+      'status_state' => array_rand(uc_order_state_list()),
+      'status_weight' => mt_rand(-10, 10),
+    );
+    $this->drupalPostForm(NULL, $edit, 'Create');
+    $this->assertText($edit['status_id'], 'Custom status ID found.');
+    $this->assertFieldByName('order_statuses[' . $edit['status_id'] . '][title]', $edit['status_title'], 'Custom status title found.');
+    $this->assertFieldByName('order_statuses[' . $edit['status_id'] . '][weight]', $edit['status_weight'], 'Custom status weight found.');
+
+    // Set an order to the custom status.
+    $this->drupalPostForm('admin/store/orders/' . $order->id(), array('status' => $edit['status_id']), 'Update');
+    $this->drupalGet('admin/store/orders/view');
+    $this->assertText($edit['status_title'], 'Order displays custom status title.');
+  }
+
   protected function ucCreateOrder($customer) {
     $order = uc_order_new($customer->id());
     uc_order_comment_save($order->id(), 0, t('Order created programmatically.'), 'admin');
diff --git a/uc_order/uc_order.admin.inc b/uc_order/uc_order.admin.inc
index e8dcebc..7397c56 100644
--- a/uc_order/uc_order.admin.inc
+++ b/uc_order/uc_order.admin.inc
@@ -6,30 +6,6 @@
  */
 
 /**
- * Themes the order status table in the order workflow settings.
- *
- * @see uc_order_workflow_form()
- * @ingroup themeable
- */
-function theme_uc_order_status_table($variables) {
-  $form = $variables['form'];
-
-  $header = array(t('ID'), t('Title'), t('List position'), t('State'), t('Remove'));
-
-  foreach (element_children($form) as $state_id) {
-    $rows[] = array(
-      drupal_render($form[$state_id]['id']),
-      drupal_render($form[$state_id]['title']),
-      drupal_render($form[$state_id]['weight']),
-      drupal_render($form[$state_id]['state']),
-      array('data' => drupal_render($form[$state_id]['remove']), 'align' => 'center'),
-    );
-  }
-
-  return theme('table', array('header' => $header, 'rows' => $rows));
-}
-
-/**
  * Creates a new order for the specified customer, ready for editing.
  */
 function uc_order_create_for_user($account) {
diff --git a/uc_order/uc_order.module b/uc_order/uc_order.module
index df4492b..13efb3d 100644
--- a/uc_order/uc_order.module
+++ b/uc_order/uc_order.module
@@ -183,10 +183,6 @@ function uc_order_theme($existing, $type, $theme, $path) {
       'variables' => array('content' => NULL),
       'template' => 'uc-order-invoice-page',
     ),
-    'uc_order_status_table' => array(
-      'render element' => 'form',
-      'file' => 'uc_order.admin.inc',
-    ),
     'uc_order_edit_form' => array(
       'render element' => 'form',
       'file' => 'uc_order.admin.inc',
