diff --git a/includes/ckeditor.features.inc b/includes/ckeditor.features.inc
index 12f05fa..a9c26bc 100644
--- a/includes/ckeditor.features.inc
+++ b/includes/ckeditor.features.inc
@@ -73,17 +73,8 @@ function ckeditor_profile_features_export_render($module_name, $data) {
   $roles = user_roles();
   foreach ($data as $name) {
     $profile = (array) ckeditor_profile_load($name);
-
-    // Convert Role IDs into role names only
-    $roles = array_values((array) $profile['rids']);
-    if (empty($roles)) {
-      $profile['roles'] = array();
-    }
-    else {
-      $profile['roles'] = array_combine($roles, $roles);
-    }
-    unset($profile['rids']);
-
+    $profile['roles'] = $profile['rids']; // maintain compatibility with earlier version
+    unset($profile['rids']); 
     $profiles[$name] = $profile;
   }
   $code = '  $data = '. features_var_export($profiles, '  ') .';'. PHP_EOL;
@@ -105,7 +96,7 @@ function ckeditor_profile_features_revert($module) {
 
     // Restore the profile roles
     foreach ($roles as $rid => $role_name) {
-      if (in_array($role_name, (array) $profile['roles'])) {
+      if (in_array($role_name, (array) $profile['roles']) || array_key_exists($rid, (array) $profile['roles'])) {
         if (!db_result(db_query("SELECT rid FROM {ckeditor_role} WHERE rid = %d AND name = '%s'", $rid, $name))) {
           db_query("INSERT INTO {ckeditor_role} (rid, name) VALUES(%d, '%s')", $rid, $name);
         }
