diff --git a/modules/commerce_license_role/plugins/license_type/CommerceLicenseRole.class.php b/modules/commerce_license_role/plugins/license_type/CommerceLicenseRole.class.php
index 728431d..ed8a306 100644
--- a/modules/commerce_license_role/plugins/license_type/CommerceLicenseRole.class.php
+++ b/modules/commerce_license_role/plugins/license_type/CommerceLicenseRole.class.php
@@ -19,7 +19,7 @@ class CommerceLicenseRole extends CommerceLicenseBase  {
    */
   public function save() {
     if ($this->uid && $this->product_id) {
-      $role = $this->wrapper->product->commerce_license_role->value();
+      $rid = $this->wrapper->product->commerce_license_role->value();
       $owner = $this->wrapper->owner->value();
       $save_owner = FALSE;
       if (!empty($this->license_id)) {
@@ -35,15 +35,16 @@ class CommerceLicenseRole extends CommerceLicenseBase  {
       }
       // The owner of an active license must have the role.
       if ($this->status == COMMERCE_LICENSE_ACTIVE) {
-        if (!isset($owner->roles[$role])) {
-          $owner->roles[$role] = $role;
+        if (!isset($owner->roles[$rid]) && ($role = user_role_load($rid))) {
+          $owner->roles[$rid] = $role->name;
           $save_owner = TRUE;
         }
       }
       elseif ($this->status > COMMERCE_LICENSE_ACTIVE) {
         // The owner of an inactive license must not have the role.
-        if (isset($owner->roles[$role])) {
-          unset($owner->roles[$role]);
+        $role_object = user_role_load($rid)
+        if (isset($owner->roles[$rid])) {
+          unset($owner->roles[$rid]);
           $save_owner = TRUE;
         }
       }
