diff --git a/includes/flag.admin.inc b/includes/flag.admin.inc
index 1f0e797..230fe2d 100644
--- a/includes/flag.admin.inc
+++ b/includes/flag.admin.inc
@@ -343,10 +343,11 @@ function flag_form($form, &$form_state, $name, $type = NULL) {
   $form['access']['roles'] = array(
     '#title' => t('Roles that may use this flag'),
     '#access' => empty($flag->locked['roles']),
     '#description' => t('Users may only unflag content if they have access to flag the content initially. Checking <em>authenticated user</em> will allow access for all logged-in users.'),
     '#theme' => 'flag_form_roles',
+    '#theme_wrappers' => array('form_element'),
     '#weight' => -2,
     '#attached' => array(
       'js' => array(drupal_get_path('module', 'flag') . '/theme/flag-admin.js'),
       'css' => array(drupal_get_path('module', 'flag') . '/theme/flag-admin.css'),
     ),
@@ -408,11 +409,11 @@ function flag_form($form, &$form_state, $name, $type = NULL) {
 
   $form['link_options'] = array(
     '#type' => 'fieldset',
     '#title' => t('Link options'),
     '#description' => t('The selected link type may require these additional settings.'),
-    '#attributes' => array('id' => 'link-options'),
+    '#id' => 'link-options',
     '#weight' => 21,
   );
 
   $form['link_options']['flag_confirmation'] = array(
     '#type' => 'textfield',
