diff --git a/cas_attributes.tokens.inc b/cas_attributes.tokens.inc
index 5bb085c..c944bc8 100644
--- a/cas_attributes.tokens.inc
+++ b/cas_attributes.tokens.inc
@@ -26,22 +26,31 @@ function cas_attributes_tokens($type, $tokens, array $data = array(), array $opt
   $replacements = array();
 
   if ($type == 'cas' && !empty($data['cas'])) {
-    $cas = $data['cas'];
-
     // Provide [cas:attribute:?] dynamic tokens.
     if ($attribute_tokens = token_find_with_prefix($tokens, 'attribute')) {
-      $attribute = array_change_key_case(cas_phpcas_attributes($cas));
+      $attributes = array_change_key_case(cas_phpcas_attributes($data['cas']));
+      // Make sure all attribute values are arrays.
+      foreach($attributes as $key => $attribute) {
+        if (!is_array($attribute)) {
+          $attributes[$key] = array($attribute);
+        }
+      }
+
       foreach ($attribute_tokens as $name => $original) {
-        $name = drupal_strtolower($name);
-        if (isset($attribute[$name])) {
-          $value = $attribute[$name];
-          if (is_array($value)) {
-            $value = $value[0];
-          }
-          $replacements[$original] = $sanitize ? check_plain($value) : $value;
+        // Break out the token into attributes and the options for them.
+        $token_parts = explode(':', $name);
+        // If there are no options specified have it return the first value.
+        if (count($token_parts) == 1) {
+          $token_parts[] = 'first';
+        }
+
+        $attribute = drupal_strtolower(array_shift($token_parts));
+        if (isset($attributes[$attribute])) {
+          $option_key = implode(':', $token_parts);
+          $replacements += token_generate('array', array($option_key => $original), array('array' => $attributes[$attribute]), $options);
         }
         elseif ($name == '?') {
-          $keys = array_keys($attribute);
+          $keys = array_keys($attributes);
           if ($sanitize) {
             $keys = array_map('check_plain', $keys);
           }
