diff --git a/contrib/mm_token/mm_token.module b/contrib/mm_token/mm_token.module
index ab333a3..e76bf8c 100644
--- a/contrib/mm_token/mm_token.module
+++ b/contrib/mm_token/mm_token.module
@@ -129,5 +129,7 @@ function mm_token_token_list($type = 'all') {
 
   }
 
-  return $tokens;
+  if (!empty($tokens)) {
+    return $tokens;
+  }
 }
\ No newline at end of file
diff --git a/media_mover_api.module b/media_mover_api.module
index c283612..7ff71ea 100755
--- a/media_mover_api.module
+++ b/media_mover_api.module
@@ -166,8 +166,9 @@ function media_mover_api_form_alter(&$form, $form_state, $form_id) {
   }
 
   // display MM files on node edit page if there are MM files
+  // WARNING $configuration is not set. The following code is broken.
   if (isset($form['type']) && $form['#node']->media_mover) {
-    if ($configuration->settings->mma_node_edit_item_show) {
+    if (!empty($configuration->settings->mma_node_edit_item_show)) {
       // get the list of files
 	    if ($html = media_mover_api_files_node_edit_display($form['#node'])) {
 	      $form['media_mover'] = array(
@@ -2832,11 +2833,11 @@ function media_mover_api_file_fetch($id, $reset = FALSE) {
 
   // can we use cached data?
   if (! $reset) {
-    if (isset($cached['mmfid'][$id['mmfid']])) {
+    if (isset($id['mmfid']) && isset($cached['mmfid'][$id['mmfid']])) {
       $file = $cached['mmfid'][$id['mmfid']];
       return $file;
     }
-    elseif (isset($cached['fid'][$id['fid']])) {
+    elseif (isset($id['fid']) && isset($cached['fid'][$id['fid']])) {
       $file = $cached['fid'][$id['fid']];
       return $file;
     }
@@ -2877,10 +2878,11 @@ function media_mover_api_file_fetch_get_additional($item) {
   // get the configuration this file was created with
   $configuration = media_mover_api_get_configuration($item['cid']);
   // get ready to fetch additional items
+  // WARNING $item_config is not set. The following code is broken.
   $fetch_items = array();
   foreach (media_mover_api_verbs() as $verb) {
     $function = $configuration->{$verb}->module . '_media_mover';
-    if ($new_items = $function('fetch', $item_config->{$verb}->action, $configuration, $item)) {
+    if (isset($item_config->{$verb}->action) && $new_items = $function('fetch', $item_config->{$verb}->action, $configuration, $item)) {
       $fetch_items[$item_config->{$verb}->module][$configuration->{$verb}->action] = $new_items;
     }
   }
@@ -3084,7 +3086,7 @@ function media_mover_api_node_update($node) {
   // we only do this if there are media mover files that we need to delete
   // because they are linked to files on a node
   // we do not handle creation as other modules are responsible for that
-  if ($node->media_mover) {
+  if (!empty($node->media_mover)) {
     // build a list of all the media mover files associated with this node
     foreach ($node->media_mover as $cid => $mm_files) {
       if ($mm_files) {
