diff --git a/themekey_base.inc b/themekey_base.inc
index af0f383..0b22d54 100644
--- a/themekey_base.inc
+++ b/themekey_base.inc
@@ -25,10 +25,10 @@
 function themekey_invoke_modules($hook) {
   $return = array();
   foreach (variable_get('themekey_modules', array('node')) as $module) {
-    if (module_exists($module) && is_readable(drupal_get_path('module', 'themekey') .'/modules/'. $module .'.inc')) {
-      require_once(drupal_get_path('module', 'themekey') .'/modules/'. $module .'.inc');
+    if (module_exists($module) && is_readable(drupal_get_path('module', 'themekey') .'/modules/themekey.'. $module .'.inc')) {
+      require_once(drupal_get_path('module', 'themekey') .'/modules/themekey.'. $module .'.inc');
 
-      $function = str_replace('.', '_', $module) .'_'. $hook;
+      $function = 'themekey_' . $module . '_' . $hook;
       if (function_exists($function)) {
         $return = array_merge_recursive($return, $function());
       }
diff --git a/themekey_build.inc b/themekey_build.inc
index d127802..cd55828 100644
--- a/themekey_build.inc
+++ b/themekey_build.inc
@@ -130,11 +130,11 @@ function themekey_rebuild() {
  */
 function themekey_scan_modules() {
   $modules = array();
-  $files = file_scan_directory(dirname(__FILE__) . '/modules', '^themekey.[a-z]+.inc$');
+  $files = file_scan_directory(dirname(__FILE__) . '/modules', '^themekey\.[a-z]+\.inc$');
   foreach ($files as $file) {
     list( , $module) = explode('.', $file->name);
     if (module_exists($module)) {
-      $modules[] = $file->name;
+      $modules[] = $module;
     }
   }
 
