diff --git a/flag_lists.admin.inc b/flag_lists.admin.inc
index 121d5b9..d817e85 100644
--- a/flag_lists.admin.inc
+++ b/flag_lists.admin.inc
@@ -91,7 +91,8 @@ function flag_lists_add_js($type = NULL) {
     exit();
   }
 
-  $name = check_plain($_REQUEST['name']);
+  $name = $_REQUEST['name'];
+
   if (!isset($name) || empty($name)) {
     drupal_json_output(array('error' => t('List name not supplied.')));
     exit();
@@ -343,7 +344,7 @@ function flag_lists_delete_confirm($form, $form_state, $name) {
   $form['fid'] = array('#type' => 'value', '#value' => $flag->fid);
 
   return confirm_form($form,
-    t('Are you sure you want to delete %title?', array('%title' => $flag->get_title())),
+    t('Are you sure you want to delete @title?', array('@title' => $flag->get_title())),
     isset($_GET['destination']) ? $_GET['destination'] : '/',
     t('This action cannot be undone.'),
     t('Delete'), t('Cancel')
diff --git a/flag_lists.module b/flag_lists.module
index bd6b865..188290d 100644
--- a/flag_lists.module
+++ b/flag_lists.module
@@ -280,7 +280,7 @@ function flag_lists_permission() {
 /**
  * Implementation of hook_form_alter().
  */
-function flag_lists_form_alter(&$form, &$form_state, $form_id) {
+function flag_lists_form_alter($form, &$form_state, $form_id) {
   switch ($form_id) {
     case 'flag_form':
       // A template flag should always have a record in the flag_lists_types table.
@@ -480,10 +480,11 @@ function flag_lists_ops_form($form, &$form_state, $flo) {
   return $form;
 }
 
-function flag_lists_ops_form_ajax_callback($form, $form_state) {
+function flag_lists_ops_form_ajax_callback($form, &$form_state) {
   // The form has already been submitted and updated. We can return the replaced
   // item as it is.
   $message = '';
+
   if (!flag_lists_ops_form_validate($form, $form_state)) {
     $message = flag_lists_ops_form_submit($form, $form_state);
   }
@@ -496,12 +497,13 @@ function flag_lists_ops_form_ajax_callback($form, $form_state) {
   return $form['flag_lists_' . $form_state['flo_operation']];
 }
 
-function flag_lists_ops_form_validate(&$form, &$form_state) {
+function flag_lists_ops_form_validate($form, &$form_state) {
   global $user;
 
   $error_count = 0;
 
   // Check to see if an items are selected, if not fail right away.
+
   if (!isset($_REQUEST['flag_lists_ops']) || empty($_REQUEST['flag_lists_ops'])) {
     form_set_error('', t('No content selected.'));
     $error_count++;
@@ -548,12 +550,13 @@ function flag_lists_ops_form_validate(&$form, &$form_state) {
   return $error_count;
 }
 
-function flag_lists_ops_form_submit(&$form, &$form_state) {
+function flag_lists_ops_form_submit($form, &$form_state) {
   // Get the $ops from the originating form.
   $ops = $_REQUEST['flag_lists_ops'];
   $ops = is_array($ops) ? $ops : array($ops);
   $success_count = 0;
   // Get the operation, or set it
+
   switch ($form_state['values']['flag_lists_' . $form_state['flo_operation']]['operation']) {
     case 'unflag':
       $operation = 'unflag';
diff --git a/js/flag_lists_ops.js b/js/flag_lists_ops.js
index f323bdb..bd9d9a9 100644
--- a/js/flag_lists_ops.js
+++ b/js/flag_lists_ops.js
@@ -40,6 +40,7 @@
                 "Create a new list": function() {
                   var name = $('input.name', $(this)).val();
                   var type = $('select.type', $(this)).val();
+                  name = encodeURIComponent(name);
 
                   $.getJSON(Drupal.settings.flag_lists.json_path.replace('%', type)+'?name='+name, function(data) {
                     if (data.error) {
@@ -48,6 +49,7 @@
                     else {
                       select.append('<option value="'+data.flag.fid+'">'+data.flag.title+'</option>');
                       $('input.name', $(this)).val('');
+                      location.reload(true);
                       dialog.dialog('close');
                     }
                   });
