--- context_ui.admin.inc	(revision 2329)
+++ context_ui.admin.inc	(working copy)
@@ -841,7 +841,7 @@
  * hook_validate()
  */
 function context_ui_form_validate($form, &$form_state) {
-  if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['values']['value']) {
+  if (current($form_state['clicked_button']['#parents']) == 'submit' && $form_state['values']['value']) {
     // Check for string identifier sanity
     foreach (array('value', 'attribute', 'namespace') as $elem) {
       if (!preg_match('!^[a-z0-9_]+$!', $form_state['values'][$elem])) {
@@ -933,13 +933,14 @@
  * Submit handler for main context_ui form.
  */
 function context_ui_form_submit($form, &$form_state) {
-  switch ($form_state['clicked_button']['#id']) {
+  $id = current($form_state['clicked_button']['#parents']);
+  switch ($id) {
     // Send user to delete confirmation page
-    case 'edit-delete':
+    case 'delete':
       $form_state['redirect'] = 'admin/build/context/'. $form_state['values']['cid'] .'/delete';
       return;
     // Process form values and save and/or update the context in the db
-    case 'edit-submit':
+    case 'submit':
       $context = context_ui_form_process($form_state['values']);
       $result = context_save_context($context);
       if ($result) {
