diff --git a/fe_nodequeue.module b/fe_nodequeue.module
index 3edf692..439c2f8 100644
--- a/fe_nodequeue.module
+++ b/fe_nodequeue.module
@@ -19,10 +19,7 @@ function fe_nodequeue_features_api() {
  */
 function fe_nodequeue_features_export_options() {
   $options = array();
-  $table   = 'nodequeue_queue'; 
-  
-  $query = "SELECT * FROM {{$table}}";
-  $fields = db_query($query);
+  $fields = db_query("SELECT * FROM {nodequeue_queue}");
   while ($obj = $fields->fetchObject()) {
     $options[$obj->name] = t('@name [@machine_name]', array('@name' => $obj->title, '@machine_name' => $obj->name));
   }
@@ -44,7 +41,19 @@ function fe_nodequeue_features_export($data, &$export, $module_name = '') {
       $export['dependencies'][$module] = $module;
     }
     // Otherwise, export the nodequeue
-    elseif (nodequeue_load_queue_by_name($name)) {
+    elseif ($queue=nodequeue_load_queue_by_name($name)) {
+      // add dependencies for the roles that are associated with these queues
+      if($queue->roles){
+        $manipulate_all_queues = array_keys(user_roles(FALSE, 'manipulate all queues'));
+        $queue->roles = array_diff($queue->roles, $manipulate_all_queues);
+        $roles=user_roles();
+        foreach($queue->roles as $index=>$rid){
+          $export['features']['user_role'][$roles[$rid]]=$roles[$rid];
+          //convert the role from an rid to a 'machine name' for saving.
+          // this will be converted back to an rid at save time.
+          $queue->roles[$index]=$roles[$rid]; 
+        }
+      }
       $export['features']['fe_nodequeue'][$name] = $name;
     }
   }
@@ -58,19 +67,32 @@ function fe_nodequeue_features_export_render($module_name = '', $data) {
   $code = array();
   $code[] = '  $nodequeues = array();';
   $code[] = '';
-
+  $roles=user_roles();
   foreach ($data as $name) {
     if ($nodequeue = nodequeue_load_queue_by_name($name)) {
       // sort roles and types arrays into ascending order so that we can 
       // check for overridden db data without being affected by the 
       // order in which this array gets stored/loaded.
       if (!empty($nodequeue->roles)) {
+        // roles that have the 'manipulate all queues' perm will not get saved and
+        // will throw override messages as a result.
+        $manipulate_all_queues = array_keys(user_roles(FALSE, 'manipulate all queues'));
+        $nodequeue->roles = array_diff($nodequeue->roles, $manipulate_all_queues);
+        foreach($nodequeue->roles as $index=>$rid){
+          $nodequeue->roles[$index]=$roles[$rid];
+        }
         sort($nodequeue->roles);
       }
       if (!empty($nodequeue->types)) {
         sort($nodequeue->types);
       }
-
+      unset($nodequeue->qid);
+      // we dont care how many subqueues are in here since they get
+      // automatically created
+      if(module_exists('smartqueue')){
+        unset($nodequeue->subqueues);
+      }
+      
       $nodequeue_export = features_var_export($nodequeue, '  ');
 
       $code[] = "  // Exported nodequeues: {$nodequeue->name}";
@@ -97,13 +119,14 @@ function fe_nodequeue_features_revert($module) {
     if (empty($object['name'])) {
       continue;
     }
-    
-    if (!($nodequeue_queue = nodequeue_load_queue_by_name($object['name']))) {
+    $map=nodequeue_get_qid_map();
+    if ($qid=$map[$object['name']]) {
+      $object['qid']=$qid;
+    } 
+    else{
       unset($object['qid']);
-      $result = _fe_nodequeue_save_queue((array) $object);
-    } else {
-      $result = _fe_nodequeue_save_queue((array) $object);
     }
+    $result = _fe_nodequeue_save_queue((array) $object);
   }
 
   return TRUE;
@@ -123,10 +146,17 @@ function fe_nodequeue_features_rebuild($module) {
  * @return array
  */
 function _fe_nodequeue_save_queue($settings = array()) {
+  // convert roles from names to id's
+  $roles=array_flip(user_roles());
+  foreach((array)$settings['roles'] as $index=>$role){
+    //in case we are dealing with an old export with rids, dont do anything
+    if((int)$role) continue;
+    $settings['roles'][$index]=$roles[$role];
+  }
   // Simulate checkboxes.
   $settings['roles'] = drupal_map_assoc($settings['roles']);
   $settings['types'] = drupal_map_assoc($settings['types']);
-
+  
   // Simulate submitting.
   $form_state = array();
   $form_state['values'] = $settings;
