diff --git a/filefield_paths.module b/filefield_paths.module
index de8f781..447f1c3 100644
--- a/filefield_paths.module
+++ b/filefield_paths.module
@@ -380,12 +380,12 @@ function filefield_paths_process_string($value, $data, $settings = array()) {
     module_load_include('inc', 'pathauto');
   }
 
-  // Process string tokens.
-  $value = token_replace($value, $data, array('clear' => TRUE));
-
   $paths = explode('/', $value);
   foreach ($paths as $i => &$path) {
 
+    // Process string tokens.
+    $path = token_replace($path, $data, array('clear' => TRUE));
+
     // Cleanup with pathauto.
     if ($pathauto == TRUE) {
       if ('file_name' == $settings['context'] && count($paths) == $i + 1) {
