diff --git a/filefield_paths.module b/filefield_paths.module
index 2818468..8de0af6 100644
--- a/filefield_paths.module
+++ b/filefield_paths.module
@@ -390,7 +390,8 @@ function filefield_paths_node_update(&$node) {
       // Invoke hook_filefield_paths_process_file().
       foreach (module_implements('filefield_paths_process_file') as $module) {
         $function = "{$module}_filefield_paths_process_file";
-        $function(($file['new'] || variable_get("ffp_{$node->type}_{$file['name']}", 0)), $file, $ffp['#settings'][$file['name']], $node, $update);
+        $settings_name = isset($ffp['#settings'][$file['name']])? $ffp['#settings'][$file['name']] : '';
+        $function(($file['new'] || variable_get("ffp_{$node->type}_{$file['name']}", 0)), $file, $settings_name, $node, $update);
       }
     }
 
@@ -412,7 +413,7 @@ function filefield_paths_node_update(&$node) {
     }
 
     // Cleanup temporary paths.
-    if ($ffp['#settings']) {
+    if (isset($ffp['#settings'])) {
       foreach ($ffp['#settings'] as $name => $field) {
         $paths = explode('/', $field['filepath']['value']);
         filefield_paths_cleanup_temp($paths);
@@ -604,9 +605,9 @@ function filefield_paths_token_list($type = 'all') {
  * Implements hook_token_values().
  */
 function filefield_paths_token_values($type, $object = NULL) {
-  if ($type == 'field') {
+  $tokens = array();
+  if ($type == 'field' && isset($object[0]['filename'])) {
     $item = pathinfo($object[0]['filename']);
-    $tokens = array();
     if (!module_exists('filefield')) {
       // PHP < 5.2: pathinfo() doesn't return 'filename' variable.
       $tokens['filefield-onlyname'] = isset($item['filename'])
@@ -636,8 +637,8 @@ function filefield_paths_token_values($type, $object = NULL) {
         ? ".{$object[0]['type']}"
         : '';
     }
-    return $tokens;
   }
+  return $tokens;
 }
 
 /**
