diff --git a/block/flickr_block.install b/block/flickr_block.install
index 49ab66c..8988b36 100644
--- a/block/flickr_block.install
+++ b/block/flickr_block.install
@@ -9,7 +9,7 @@
  */
 function flickr_block_install() {
   $t = get_t();
-  if (module_exists('taxonomy') && variable_get('flickr_smart', 1)) {
+  if (function_exists('taxonomy') && variable_get('flickr_smart', 1)) {
     $vocab = (object) array(
       'name' => 'Flickr tags',
       'machine_name' => 'flickr_tags',
@@ -93,7 +93,7 @@ function flickr_block_install() {
     }
   }
 
-  if (module_exists('date_popup') && variable_get('flickr_smart', 1)) {
+  if (function_exists('date_popup') && variable_get('flickr_smart', 1)) {
     $field = array(
       'field_name' => 'field_flickr_date',
       'type' => 'datetime',
@@ -175,7 +175,7 @@ function flickr_block_install() {
     }
   }
 
-  if (module_exists('geofield') && variable_get('flickr_smart', 1)) {
+  if (function_exists('geofield') && variable_get('flickr_smart', 1)) {
     $field = array(
       'translatable' => '0',
       'settings' => array(
@@ -230,7 +230,7 @@ function flickr_block_install() {
       field_create_instance($instance);
     }
 
-    if (isset($vocabulary) && module_exists('date_popup')) {
+    if (isset($vocabulary) && function_exists('date_popup')) {
       foreach (range(0, 16) as $delta) {
         variable_set('flickr_block_' . $delta, array(
           'vocab' => $vocabulary->vid,
@@ -239,7 +239,7 @@ function flickr_block_install() {
         ));
       }
     }
-    elseif (module_exists('date_popup')) {
+    elseif (function_exists('date_popup')) {
       foreach (range(0, 16) as $delta) {
         variable_set('flickr_block_' . $delta, array(
           'date' => 'field_flickr_date',
@@ -265,7 +265,7 @@ function flickr_block_install() {
  */
 function flickr_block_update_7101() {
   $t = get_t();
-  if (module_exists('taxonomy')) {
+  if (function_exists('taxonomy')) {
     $vocab = (object) array(
       'name' => 'Flickr tags',
       'machine_name' => 'flickr_tags',
@@ -401,7 +401,7 @@ function flickr_block_update_7101() {
  */
 function flickr_block_update_7102() {
   $t = get_t();
-  if (module_exists('date_popup')) {
+  if (function_exists('date_popup')) {
     $field = array(
       'field_name' => 'field_flickr_date',
       'type' => 'datetime',
@@ -483,7 +483,7 @@ function flickr_block_update_7102() {
     }
   }
 
-  if (module_exists('geofield')) {
+  if (function_exists('geofield')) {
     $field = array(
       'translatable' => '0',
       'settings' => array(
@@ -538,7 +538,7 @@ function flickr_block_update_7102() {
       field_create_instance($instance);
     }
 
-    if (isset($vocabulary) && module_exists('date_popup')) {
+    if (isset($vocabulary) && function_exists('date_popup')) {
       foreach (range(0, 16) as $delta) {
         variable_set('flickr_block_' . $delta, array(
           'vocab' => $vocabulary->vid,
@@ -547,7 +547,7 @@ function flickr_block_update_7102() {
         ));
       }
     }
-    elseif (module_exists('date_popup')) {
+    elseif (function_exists('date_popup')) {
       foreach (range(0, 16) as $delta) {
         variable_set('flickr_block_' . $delta, array(
           'date' => 'field_flickr_date',
@@ -644,7 +644,7 @@ function flickr_block_uninstall() {
   foreach (range(0, 16) as $delta) {
     variable_del("flickr_block_{$delta}");
   }
-  if (module_exists('taxonomy')) {
+  if (function_exists('taxonomy')) {
     $vocabulary = taxonomy_vocabulary_machine_name_load('flickr_tags');
     if ($vocabulary) {
       field_delete_field('field_' . $vocabulary->machine_name);
diff --git a/block/flickr_block.module b/block/flickr_block.module
index 560f1b4..0d6b6a2 100644
--- a/block/flickr_block.module
+++ b/block/flickr_block.module
@@ -280,7 +280,7 @@ function flickr_block_configure($delta = '') {
     '#title' => t('Media type'),
     '#default_value' => $settings['media'],
   );
-  if (module_exists('taxonomy')) {
+  if (function_exists('taxonomy')) {
     // Get a list of existing vocabularies.
     $vocabulary = taxonomy_get_vocabularies();
     $checklist_vocab_array = array('0' => '<none>');
@@ -349,11 +349,11 @@ function flickr_block_configure($delta = '') {
       );
     }
   }
-  if (module_exists('geofield') || module_exists('location_node')) {
+  if (function_exists('geofield') || function_exists('location_node')) {
     // Get a list of existing geofields.
     $fields = field_read_fields(array('type' => 'geofield'));
     $checklist_fields_array = array('0' => '<none>');
-    if (module_exists('location_node')) {
+    if (function_exists('location_node')) {
       $checklist_fields_array = array('0' => '<none>', '1' => 'Location module');
     }
     foreach ($fields as $item) {
@@ -370,7 +370,7 @@ function flickr_block_configure($delta = '') {
       '#description'   => t("Limit the Flickr images to those that have a geo location near to the geofield found for the node on the page the block is displayed on.<br />If not on a node page, all photos will be displayed. To avoid this set the visibility settings below to <em>Only the listed pages</em> specified as <em>node/*</em>."),
     );
   }
-  if (module_exists('date')) {
+  if (function_exists('date')) {
     // Get a list of existing date ields.
     $fields = field_read_fields(array('type' => 'datetime'));
     $checklist_fields_array = array('0' => '<none>');
@@ -403,18 +403,18 @@ function flickr_block_configure($delta = '') {
       unset($form["flickr_block_{$delta}_photoset"]);
       unset($form['filter_settings']["flickr_block_{$delta}_sort"]);
       unset($form['filter_settings']["flickr_block_{$delta}_filter"]);
-      if (module_exists('taxonomy')) {
+      if (function_exists('taxonomy')) {
         unset($form['filter_settings']["flickr_block_{$delta}_vocab"]);
         unset($form['filter_settings']["flickr_block_{$delta}_extend"]);
         unset($form['filter_settings']["flickr_block_{$delta}_tag_mode"]);
       }
-      if (module_exists('geofield') || module_exists('location_node')) {
+      if (function_exists('geofield') || function_exists('location_node')) {
         unset($form['filter_settings']["flickr_block_{$delta}_geo"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
       // Photoset, not photos.
@@ -440,13 +440,13 @@ function flickr_block_configure($delta = '') {
       unset($form["flickr_block_{$delta}_group_id"]);
       unset($form["flickr_block_{$delta}_photoset"]);
       unset($form['filter_settings']["flickr_block_{$delta}_filter"]);
-      if (module_exists('taxonomy')) {
+      if (function_exists('taxonomy')) {
         unset($form['filter_settings']["flickr_block_{$delta}_tag_mode"]);
       }
-      if (module_exists('geofield') || module_exists('location_node')) {
+      if (function_exists('geofield') || function_exists('location_node')) {
         unset($form['filter_settings']["flickr_block_{$delta}_geo"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
       break;
@@ -478,13 +478,13 @@ function flickr_block_configure($delta = '') {
       unset($form["flickr_block_{$delta}_photoset"]);
       unset($form['flickr_block_note']);
       unset($form['filter_settings']["flickr_block_{$delta}_filter"]);
-      if (module_exists('taxonomy')) {
+      if (function_exists('taxonomy')) {
         unset($form['filter_settings']["flickr_block_{$delta}_tag_mode"]);
       }
-      if (module_exists('geofield') || module_exists('location_node')) {
+      if (function_exists('geofield') || function_exists('location_node')) {
         unset($form['filter_settings']["flickr_block_{$delta}_geo"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
       break;
@@ -496,15 +496,15 @@ function flickr_block_configure($delta = '') {
       unset($form['flickr_block_note']);
       unset($form['filter_settings']["flickr_block_{$delta}_sort"]);
       unset($form['filter_settings']["flickr_block_{$delta}_filter"]);
-      if (module_exists('taxonomy')) {
+      if (function_exists('taxonomy')) {
         unset($form['filter_settings']["flickr_block_{$delta}_vocab"]);
         unset($form['filter_settings']["flickr_block_{$delta}_extend"]);
         unset($form['filter_settings']["flickr_block_{$delta}_tag_mode"]);
       }
-      if (module_exists('geofield') || module_exists('location_node')) {
+      if (function_exists('geofield') || function_exists('location_node')) {
         unset($form['filter_settings']["flickr_block_{$delta}_geo"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
       // Photosets, not photos.
@@ -536,13 +536,13 @@ function flickr_block_configure($delta = '') {
       unset($form["flickr_block_{$delta}_group_id"]);
       unset($form['flickr_block_note']);
       unset($form['filter_settings']["flickr_block_{$delta}_filter"]);
-      if (module_exists('taxonomy')) {
+      if (function_exists('taxonomy')) {
         unset($form['filter_settings']["flickr_block_{$delta}_tag_mode"]);
       }
-      if (module_exists('geofield') || module_exists('location_node')) {
+      if (function_exists('geofield') || function_exists('location_node')) {
         unset($form['filter_settings']["flickr_block_{$delta}_geo"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
       break;
@@ -552,13 +552,13 @@ function flickr_block_configure($delta = '') {
       unset($form["flickr_block_{$delta}_group_id"]);
       unset($form["flickr_block_{$delta}_photoset"]);
       unset($form['flickr_block_note']);
-      if (module_exists('taxonomy')) {
+      if (function_exists('taxonomy')) {
         unset($form['filter_settings']["flickr_block_{$delta}_vocab"]);
       }
-      if (module_exists('geofield') || module_exists('location_node')) {
+      if (function_exists('geofield') || function_exists('location_node')) {
         unset($form['filter_settings']["flickr_block_{$delta}_geo"]);
       }
-      if (module_exists('date')) {
+      if (function_exists('date')) {
         unset($form['filter_settings']["flickr_block_{$delta}_date"]);
       }
       if (empty($default_userid)) {
@@ -645,16 +645,16 @@ function flickr_block_save($delta = '', $edit = array()) {
     // User Flickr photos.
     case 0:
     case 2:
-      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $vocab = function_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       else {
         $tag_mode = 'context';
       }
-      $geo = module_exists('geofield') || module_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
-      $date = module_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
+      $geo = function_exists('geofield') || function_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
+      $date = function_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
       variable_set('flickr_block_' . $delta, array(
         'show_n' => (int) $edit["flickr_block_{$delta}_show_n"],
         'size' => $edit["flickr_block_{$delta}_size"],
@@ -676,9 +676,9 @@ function flickr_block_save($delta = '', $edit = array()) {
     case 14:
     case 15:
     case 16:
-      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $vocab = function_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       else {
@@ -715,16 +715,16 @@ function flickr_block_save($delta = '', $edit = array()) {
 
         }
       }
-      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $vocab = function_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       else {
         $tag_mode = 'context';
       }
-      $geo = module_exists('geofield') || module_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
-      $date = module_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
+      $geo = function_exists('geofield') || function_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
+      $date = function_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
       variable_set('flickr_block_' . $delta, array(
         'user_id' => $edit["flickr_block_{$delta}_user_id"],
         'show_n' => (int) $edit["flickr_block_{$delta}_show_n"],
@@ -761,9 +761,9 @@ function flickr_block_save($delta = '', $edit = array()) {
 
         }
       }
-      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $vocab = function_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       else {
@@ -816,16 +816,16 @@ function flickr_block_save($delta = '', $edit = array()) {
     // Photos from a Flickr group.
     case 6:
     case 10:
-      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $vocab = function_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       else {
         $tag_mode = 'context';
       }
-      $geo = module_exists('geofield') || module_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
-      $date = module_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
+      $geo = function_exists('geofield') || function_exists('location_node') ? $edit["flickr_block_{$delta}_geo"] : 0;
+      $date = function_exists('date') ? $edit["flickr_block_{$delta}_date"] : 0;
       variable_set('flickr_block_' . $delta, array(
         'group_id' => $edit["flickr_block_{$delta}_group_id"],
         'show_n' => (int) $edit["flickr_block_{$delta}_show_n"],
@@ -847,9 +847,9 @@ function flickr_block_save($delta = '', $edit = array()) {
     // Photos from a Flickr photoset.
     case 7:
     case 8:
-      $vocab = module_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $vocab = function_exists('taxonomy') ? (int) $edit["flickr_block_{$delta}_vocab"] : 0;
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       else {
@@ -873,8 +873,8 @@ function flickr_block_save($delta = '', $edit = array()) {
     // Random photos with a specific tag from a Flickr user.
     case 11:
       $userid = $edit["flickr_block_{$delta}_user_id"];
-      $extend = module_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
-      if (module_exists('taxonomy')) {
+      $extend = function_exists('taxonomy') ? $edit["flickr_block_{$delta}_extend"] : 0;
+      if (function_exists('taxonomy')) {
         $tag_mode = $extend ? 'any' : $edit["flickr_block_{$delta}_tag_mode"];
       }
       if (!empty($userid) && $userid != 'public') {
@@ -996,7 +996,7 @@ function flickr_block_view($delta = '') {
         case 'user':
           if ($uid = (int) arg(1)) {
             $user = user_load($uid);
-            if (module_exists('taxonomy') && $settings['vocab'] != 0) {
+            if (function_exists('taxonomy') && $settings['vocab'] != 0) {
               $taxonomy = taxonomy_vocabulary_load($settings['vocab']);
               if (property_exists($user, 'field_' . $taxonomy->machine_name)) {
                 $terms_user = (!empty($settings['vocab'])) ? field_view_field('user', $user, 'field_' . $taxonomy->machine_name) : '';
@@ -1026,12 +1026,12 @@ function flickr_block_view($delta = '') {
             }
             $tags = 'from_user_page';
             // To display photos near a user on their profile.
-            if (module_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
+            if (function_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
               $value = field_get_items('user', $user, $settings['geo']);
               $lat = $value[0]['lat'];
               $lon = $value[0]['lon'];
             }
-            elseif (module_exists('location_node') && $settings['geo'] == 1 && !empty($user->locations)) {
+            elseif (function_exists('location_node') && $settings['geo'] == 1 && !empty($user->locations)) {
               $lat = $user->locations[0]['latitude'];
               $lon = $user->locations[0]['longitude'];
             }
@@ -1050,7 +1050,7 @@ function flickr_block_view($delta = '') {
           if (($nid = (int) arg(1)) && ((arg(2) == "" || arg(2) == 'view'))) {
             $node = node_load($nid);
             $user = user_load($node->uid);
-            if (module_exists('taxonomy') && $settings['vocab'] != 0) {
+            if (function_exists('taxonomy') && $settings['vocab'] != 0) {
               $taxonomy = taxonomy_vocabulary_load($settings['vocab']);
               if (property_exists($user, 'field_' . $taxonomy->machine_name)) {
                 $terms_user = (!empty($settings['vocab']) && !empty($taxonomy->machine_name)) ? field_view_field('user', $user, 'field_' . $taxonomy->machine_name) : '';
@@ -1101,12 +1101,12 @@ function flickr_block_view($delta = '') {
               $tags_user = '';
               $tags = '';
             }
-            if (module_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
+            if (function_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
               $value = field_get_items('node', $node, $settings['geo']);
               $lat = $value[0]['lat'];
               $lon = $value[0]['lon'];
             }
-            elseif (module_exists('location_node') && $settings['geo'] == 1 && !empty($node->locations)) {
+            elseif (function_exists('location_node') && $settings['geo'] == 1 && !empty($node->locations)) {
               $lat = $node->locations[0]['latitude'];
               $lon = $node->locations[0]['longitude'];
             }
@@ -1114,7 +1114,7 @@ function flickr_block_view($delta = '') {
               $lat = NULL;
               $lon = NULL;
             }
-            if (module_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
+            if (function_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
               $value = field_get_items('node', $node, $settings['date']);
               $datefrom = substr($value[0]['value'], 0, strrpos($value[0]['value'], ' '));
               $dateto = substr($value[0]['value2'], 0, strrpos($value[0]['value2'], ' '));
@@ -1194,7 +1194,7 @@ function flickr_block_view($delta = '') {
     case 5:
       if (($nid = (int) arg(1)) && arg(0) == 'node' && ((arg(2) == "" || arg(2) == 'view'))) {
         $node = node_load($nid);
-        if (module_exists('taxonomy') && $settings['vocab'] != 0) {
+        if (function_exists('taxonomy') && $settings['vocab'] != 0) {
           $taxonomy = taxonomy_vocabulary_load($settings['vocab']);
           if (property_exists($node, 'field_' . $taxonomy->machine_name)) {
             $terms = (!empty($settings['vocab']) && !empty($taxonomy->machine_name)) ? field_view_field('node', $node, 'field_' . $taxonomy->machine_name) : '';
@@ -1223,12 +1223,12 @@ function flickr_block_view($delta = '') {
         else {
           $tags = '';
         }
-        if (module_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
+        if (function_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
           $value = field_get_items('node', $node, $settings['geo']);
           $lat = $value[0]['lat'];
           $lon = $value[0]['lon'];
         }
-        elseif (module_exists('location_node') && $settings['geo'] == 1 && !empty($node->locations)) {
+        elseif (function_exists('location_node') && $settings['geo'] == 1 && !empty($node->locations)) {
           $lat = $node->locations[0]['latitude'];
           $lon = $node->locations[0]['longitude'];
         }
@@ -1236,7 +1236,7 @@ function flickr_block_view($delta = '') {
           $lat = NULL;
           $lon = NULL;
         }
-        if (module_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
+        if (function_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
           $value = field_get_items('node', $node, $settings['date']);
           $datefrom = substr($value[0]['value'], 0, strrpos($value[0]['value'], ' '));
           $dateto = substr($value[0]['value2'], 0, strrpos($value[0]['value2'], ' '));
@@ -1277,7 +1277,7 @@ function flickr_block_view($delta = '') {
     case 10:
       if (($nid = (int) arg(1)) && arg(0) == 'node' && ((arg(2) == "" || arg(2) == 'view'))) {
         $node = node_load($nid);
-        if (module_exists('taxonomy') && $settings['vocab'] != 0) {
+        if (function_exists('taxonomy') && $settings['vocab'] != 0) {
           $taxonomy = taxonomy_vocabulary_load($settings['vocab']);
           if (property_exists($node, 'field_' . $taxonomy->machine_name)) {
             $terms = (!empty($settings['vocab']) && !empty($taxonomy->machine_name)) ? field_view_field('node', $node, 'field_' . $taxonomy->machine_name) : '';
@@ -1306,12 +1306,12 @@ function flickr_block_view($delta = '') {
         else {
           $tags = '';
         }
-        if (module_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
+        if (function_exists('geofield') && !is_numeric($settings['geo']) && !empty($settings['geo'])) {
           $value = field_get_items('node', $node, $settings['geo']);
           $lat = $value[0]['lat'];
           $lon = $value[0]['lon'];
         }
-        elseif (module_exists('location_node') && $settings['geo'] == 1 && !empty($node->locations)) {
+        elseif (function_exists('location_node') && $settings['geo'] == 1 && !empty($node->locations)) {
           $lat = $node->locations[0]['latitude'];
           $lon = $node->locations[0]['longitude'];
         }
@@ -1319,7 +1319,7 @@ function flickr_block_view($delta = '') {
           $lat = NULL;
           $lon = NULL;
         }
-        if (module_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
+        if (function_exists('date') && !is_numeric($settings['date']) && !empty($settings['date'])) {
           $value = field_get_items('node', $node, $settings['date']);
           $datefrom = substr($value[0]['value'], 0, strrpos($value[0]['value'], ' '));
           $dateto = substr($value[0]['value2'], 0, strrpos($value[0]['value2'], ' '));
@@ -1345,7 +1345,7 @@ function flickr_block_view($delta = '') {
     case 8:
       if (($nid = (int) arg(1)) && arg(0) == 'node' && ((arg(2) == "" || arg(2) == 'view'))) {
         $node = node_load($nid);
-        if (module_exists('taxonomy') && $settings['vocab'] != 0) {
+        if (function_exists('taxonomy') && $settings['vocab'] != 0) {
           $taxonomy = taxonomy_vocabulary_load($settings['vocab']);
           if (property_exists($node, 'field_' . $taxonomy->machine_name)) {
             $terms = (!empty($settings['vocab']) && !empty($taxonomy->machine_name)) ? field_view_field('node', $node, 'field_' . $taxonomy->machine_name) : '';
@@ -1388,7 +1388,7 @@ function flickr_block_view($delta = '') {
       $media = $settings['media'] == 'videos' ? t('videos') : t('photos');
       if (($nid = (int) arg(1)) && arg(0) == 'node' && ((arg(2) == "" || arg(2) == 'view'))) {
         $node = node_load($nid);
-        if (module_exists('taxonomy') && $settings['vocab'] != 0) {
+        if (function_exists('taxonomy') && $settings['vocab'] != 0) {
           $taxonomy = taxonomy_vocabulary_load($settings['vocab']);
           if (property_exists($node, 'field_' . $taxonomy->machine_name)) {
             $terms = (!empty($settings['vocab']) && !empty($taxonomy->machine_name)) ? field_view_field('node', $node, 'field_' . $taxonomy->machine_name) : '';
diff --git a/cachewarmer/flickrcachewarmer.module b/cachewarmer/flickrcachewarmer.module
index 82c8702..6d909cd 100644
--- a/cachewarmer/flickrcachewarmer.module
+++ b/cachewarmer/flickrcachewarmer.module
@@ -103,7 +103,7 @@ function flickrcachewarmer_run($nids) {
         // Even the cURL method returns an error.
         if ($result->code != 200) {
           // Debug info.
-          if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
+          if (variable_get('flickr_debug', 0) == 2 && function_exists('devel')) {
             dpm(t("Value of 'result' on nid %nid with error in 'function flickr_request()' with connection method '%cmethod' in 'flickr.inc'", array('%nid' => $nid, '%cmethod' => $cmethod)) . ':');
             dpm($result);
           }
diff --git a/filter/flickr_filter.admin.inc b/filter/flickr_filter.admin.inc
index 511ab04..81e9c91 100644
--- a/filter/flickr_filter.admin.inc
+++ b/filter/flickr_filter.admin.inc
@@ -44,7 +44,7 @@ function flickr_filter_form_flickr_admin_settings_alter(&$form, &$form_state) {
     '#maxlength' => 4,
   );
   // Offer the following setting if the ctools module is enabled.
-  if (module_exists('ctools')) {
+  if (function_exists('ctools')) {
     $form['filter_settings']['flickr_filter_collapsible'] = array(
       '#type' => 'checkbox',
       '#title' => t("Collapsible filter tips (collapsed by default)"),
diff --git a/filter/flickr_filter.module b/filter/flickr_filter.module
index 31b96c2..373b28b 100644
--- a/filter/flickr_filter.module
+++ b/filter/flickr_filter.module
@@ -157,7 +157,7 @@ function flickr_filter_tips($filter, $format, $long = FALSE) {
     'handle' => t('Flickr Filter options. !toggle', array('!toggle' => $toggle)),
     'content' => $output, 'collapsed' => TRUE,
   );
-  $output = module_exists('ctools') && variable_get('flickr_filter_collapsible', 1) ? theme('ctools_collapsible', $options) : $output;
+  $output = function_exists('ctools') && variable_get('flickr_filter_collapsible', 1) ? theme('ctools_collapsible', $options) : $output;
   return $output;
 }
 
diff --git a/flickr.admin.inc b/flickr.admin.inc
index 9754f69..9646a8d 100644
--- a/flickr.admin.inc
+++ b/flickr.admin.inc
@@ -347,7 +347,7 @@ function flickr_admin_settings() {
         'title' => t('Extra configuration options.'),
       ),
   ));
-  if (!module_exists('flickrstyle')) {
+  if (!function_exists('flickrstyle')) {
     $form['css_settings']['flickr_style'] = array(
       '#markup' => t("Extend the styling options with rounded corners, shadow, border and emphasize on hover by enabling the !flickr_style sub-module.", array('!flickr_style' => $flickr_style)),
     );
@@ -438,7 +438,7 @@ function flickr_admin_settings() {
       ),
   ));
   // Disable the Devel output until it is available.
-  if (!module_exists('devel')) {
+  if (!function_exists('devel')) {
     if (variable_get('flickr_debug', 0) == 2) {
       variable_set('flickr_debug', 1);
       drupal_set_message(t("The debug output has been set to 'Flickr response only'. 'Plus Devel' has been disabled until you enable the !devel_module.", array('!devel_module' => $devel_module)), 'warning', FALSE);
@@ -456,7 +456,7 @@ function flickr_admin_settings() {
     '#default_value' => variable_get('flickr_debug', 0),
   );
   // Disable the Devel output until it is available.
-  if (!module_exists('devel')) {
+  if (!function_exists('devel')) {
     $form['advanced_settings']['flickr_debug']['#options'] = array(
       t('None'),
       t('Flickr response only (as a link to an XML page in a debug message)'),
@@ -472,7 +472,7 @@ function flickr_admin_settings() {
     '#collapsed' => TRUE,
     '#weight' => 16,
   );
-  if (module_exists('flickr_block')) {
+  if (function_exists('flickr_block')) {
     $form['block_settings']['#description'] = t('Clear the cache on form submit.');
   }
   $date = l(t('Date'), 'https://www.drupal.org/project/date', array(
@@ -496,7 +496,7 @@ function flickr_admin_settings() {
   // If a block variable exists, the Flickr Block module has not been
   // uninstalled, thus disable the setting relevant only during installation.
   global $conf;
-  if (module_exists('flickr_block') || isset($conf['flickr_block_photos_per_set'])) {
+  if (function_exists('flickr_block') || isset($conf['flickr_block_photos_per_set'])) {
     $form['block_settings']['flickr_smart']['#disabled'] = TRUE;
     $form['block_settings']['flickr_smart']['#title'] = '<span class="grayed-out">' . t("Smart install of Flickr Block") . '</span> | ' . t('Disabled until uninstall of Flickr Block.');
     $form['block_settings']['flickr_smart']['#description'] = '<span class="grayed-out">' . t("On install of Flickr Block auto create Flickr taxonomy, date and geo fields on all node types to grab Flickr photos related to the node on the same page as a Flickr block based on tags, a date or a location. Enable Taxonomy (core), !date (including date_popup) and !geofield before enabling Flickr Block for the first time (or uninstall it first).", array('!date' => $date, '!geofield' => $geofield)) . '</span>';
@@ -506,7 +506,7 @@ function flickr_admin_settings() {
         'title' => t('Display Flickr photos in blocks.'),
       ),
   ));
-  if (!module_exists('flickr_block')) {
+  if (!function_exists('flickr_block')) {
     $form['block_settings']['flickr_block'] = array(
       '#markup' => t("Display Flickr photos in blocks by enabling the !flickr_block sub-module.", array('!flickr_style' => $flickr_style)),
     );
diff --git a/flickr.inc b/flickr.inc
index b34c008..4c571a2 100644
--- a/flickr.inc
+++ b/flickr.inc
@@ -146,7 +146,7 @@ function flickr_request($method, $args, $cacheable = TRUE, $return_errors = FALS
     watchdog('flickr', $message, array(), WATCHDOG_WARNING);
     if ($return_errors) {
       // Debug info.
-      if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
+      if (variable_get('flickr_debug', 0) == 2 && function_exists('devel')) {
         dpm("Value of error 'result' in 'function flickr_request()' with connection method " . "'" . $cmethod . "' in 'flickr.inc':");
         dpm($result);
       }
@@ -162,7 +162,7 @@ function flickr_request($method, $args, $cacheable = TRUE, $return_errors = FALS
     // Even the cURL method returns an error.
     if ($result->code != 200) {
       // Debug info.
-      if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
+      if (variable_get('flickr_debug', 0) == 2 && function_exists('devel')) {
         dpm("Value of 'result' with error in 'function flickr_request()' with connection method " . "'" . $cmethod . "' in 'flickr.inc':");
         dpm($result);
       }
@@ -177,7 +177,7 @@ function flickr_request($method, $args, $cacheable = TRUE, $return_errors = FALS
 
   }
   // Debug info.
-  if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
+  if (variable_get('flickr_debug', 0) == 2 && function_exists('devel')) {
     dpm("Value of 'result' in 'function flickr_request()' with the " . "'" . $cmethod . "' connection method in 'flickr.inc':");
     dpm($result);
   }
@@ -263,7 +263,7 @@ function flickr_request($method, $args, $cacheable = TRUE, $return_errors = FALS
  */
 function flickr_img($photo, $size = NULL, $attributes = NULL) {
   // Debug info.
-  if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
+  if (variable_get('flickr_debug', 0) == 2 && function_exists('devel')) {
     dpm("Value of 'photo' passed to 'function flickr_img()' in 'flickr.inc':");
     dpm($photo);
   }
@@ -345,7 +345,7 @@ function flickr_img($photo, $size = NULL, $attributes = NULL) {
     'license' => 0,
   ));
   $title = (gettype($overlay['description']) == 'integer') ? $photo['title'] : $title;
-  if (module_exists('jcaption') && (variable_get('flickr_class') != NULL || variable_get('flickr_rel') != NULL)) {
+  if (function_exists('jcaption') && (variable_get('flickr_class') != NULL || variable_get('flickr_rel') != NULL)) {
     $title = '';
   }
   return theme('image', array(
@@ -1124,7 +1124,7 @@ function flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $siz
         $rest_ok = ($total % variable_get('flickr_per_page', 100)) > 3 * $show_n ? 1 : 0;
         $page = ($sort == 'random' && isset($total) && $total > variable_get('flickr_per_page', 100) && empty($tags)) ? mt_rand(1, floor($total / variable_get('flickr_per_page', 100)) + $rest_ok) : $page;
         // Debug info.
-        if (variable_get('flickr_debug', 0) == 2 && module_exists('devel')) {
+        if (variable_get('flickr_debug', 0) == 2 && function_exists('devel')) {
           dpm("Arguments passed to 'function flickr_album()': " . '$type=' . $type . ' $delta=' . $delta . ' $id=' . $id . ' $sort=' . $sort . ' $filter=' . $filter . ' $page=' . $page . ' $per_page=' . $per_page . ' $tags=' . $tags . ' $vocab_isset=' . $vocab_isset . ' $total=' . $total . ' $lat=' . $lat . ' $lon=' . $lon . ' $radius=' . $radius . '$datefrom=' . $datefrom . ' $dateto=' . $dateto . ' $extend=' . $extend . ' $tag_mode=' . $tag_mode . ' $class=' . $class . ' $style=' . $style . ' $page=' . $page);
         }
         // Get a list of "all" the photos. This is cached.
@@ -1564,7 +1564,7 @@ function flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $siz
 
         if ($i == 0 && variable_get('flickr_block_hide_empty', 0)) {
           $output = '';
-          if (is_numeric($delta) && module_exists('flickr_block')) {
+          if (is_numeric($delta) && function_exists('flickr_block')) {
             $refresh = $sort == 'random' ? variable_get('flickr_block_refresh_random', 23) : variable_get('flickr_block_refresh_others', 31);
             // drupal_is_front_page() is added because it also can have
             // arg(0) == 'node'.
@@ -1615,7 +1615,7 @@ function flickr_album($type = 'user', $id = '39873962@N08', $show_n = NULL, $siz
     else {
       $output .= '</span>';
     }
-    if (is_numeric($delta) && module_exists('flickr_block')) {
+    if (is_numeric($delta) && function_exists('flickr_block')) {
       $refresh = $sort == 'random' ? variable_get('flickr_block_refresh_random', 23) : variable_get('flickr_block_refresh_others', 31);
       // drupal_is_front_page() is added because it also can have
       // arg(0) == 'node'.
diff --git a/flickr.install b/flickr.install
index 18b44d6..e91a3a9 100644
--- a/flickr.install
+++ b/flickr.install
@@ -8,12 +8,12 @@
  * Implements hook_install().
  */
 function flickr_install() {
-  if (module_exists('colorbox')) {
+  if (function_exists('colorbox')) {
     variable_set('flickr_class', 'colorbox');
     variable_set('flickr_rel', 'gallery-all');
     variable_set('colorbox_inline', 1);
   }
-  elseif (module_exists('lightbox2')) {
+  elseif (function_exists('lightbox2')) {
     variable_set('flickr_rel', 'lightbox[gallery]');
   }
 }
@@ -114,12 +114,12 @@ function flickr_update_7101() {
  * Enable 'Colorbox inline' to allow playing videos inside Colorbox.
  */
 function flickr_update_7102() {
-  if (module_exists('colorbox')) {
+  if (function_exists('colorbox')) {
     variable_set('flickr_class', 'colorbox');
     variable_set('flickr_rel', 'gallery-all');
     variable_set('colorbox_inline', 1);
   }
-  elseif (module_exists('lightbox2')) {
+  elseif (function_exists('lightbox2')) {
     variable_set('flickr_rel', 'lightbox[gallery]');
   }
 }
diff --git a/flickr.module b/flickr.module
index 562c6aa..a94f9fc 100644
--- a/flickr.module
+++ b/flickr.module
@@ -177,11 +177,11 @@ function flickr_user_page($user) {
   drupal_set_title(flickr_photos_page_title($user));
   $links['items'][] = l(t("@name's photos", array('@name' => $user->name)), 'flickr/' . $user->uid);
 
-  if (module_exists('flickr_sets')) {
+  if (function_exists('flickr_sets')) {
     $links['items'][]  = l(t("@name's photo sets", array('@name' => $user->name)), 'flickr/' . $user->uid . '/sets');
   }
 
-  if (module_exists('flickr_tags')) {
+  if (function_exists('flickr_tags')) {
     $links['items'][]  = l(t("@name's tags", array('@name' => $user->name)), 'flickr/' . $user->uid . '/tags');
   }
   return theme('item_list', $links) . ' ';
@@ -382,7 +382,7 @@ function theme_flickr_photo($variables) {
       break;
   }
   $sise = $size;
-  if (module_exists('flickrstyle')) {
+  if (function_exists('flickrstyle')) {
     if ((variable_get('flickrstyle_emphasize', 2) == 2 || variable_get('flickrstyle_emphasize', 2) == 3) && $size == 'q') {
       $size = flickr_one_size_bigger($size);
       $img_url = flickr_photo_img($photo, $size);
@@ -484,7 +484,7 @@ function theme_flickr_photo($variables) {
   }
   // If we zoom or enlarge an image, we should use the bigger size to retain
   // an acceptable resolution.
-  if (module_exists('flickrstyle')) {
+  if (function_exists('flickrstyle')) {
     if (variable_get('flickrstyle_emphasize', 2) == 2 || variable_get('flickrstyle_emphasize', 2) == 3) {
       if ($width < $height && $sise == 'q') {
         $width = round(150 * $width / $height);
@@ -746,7 +746,7 @@ function theme_flickr_photo($variables) {
     if (!isset($photo['media'])) {
       $photo = flickr_photos_getinfo($photo['id']);
     }
-    if ($photo['media'] == 'video' && module_exists('colorbox') && variable_get('colorbox_inline', 0) == 1) {
+    if ($photo['media'] == 'video' && function_exists('colorbox') && variable_get('colorbox_inline', 0) == 1) {
       return '<div style="display: none;">
       <div id="' . $photo['id'] . '">
         <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="https://www.flickr.com/apps/video/stewart.swf" type="application/x-shockwave-flash" height="270" width="480">
@@ -847,7 +847,7 @@ function theme_flickr_photoset($variables) {
   $min_metadata = $variables['min_metadata'];
   $per_page = (isset($variables['per_page'])) ? $variables['per_page'] : variable_get('flickr_photos_per_page', 6);
 
-  if (module_exists('flickr_sets')) {
+  if (function_exists('flickr_sets')) {
     $output = "<div class='flickr-photoset'>\n";
     $photos = flickr_photosets_getphotos($photoset['id'], array(
       'per_page' => $per_page,
