diff --git a/themekey_ui.module b/themekey_ui.module
index c6790a7..08c846a 100644
--- a/themekey_ui.module
+++ b/themekey_ui.module
@@ -92,7 +92,7 @@ function themekey_ui_nid2theme($nid) {
 
   themekey_ui_nodeapi($node, 'load');
 
-  if (!empty($node->themekey_ui_theme) && themekey_check_theme_enabled($node->themekey_ui_theme)) {
+  if (!empty($node->themekey_ui_theme) && 'default' != $node->themekey_ui_theme && themekey_check_theme_enabled($node->themekey_ui_theme)) {
     $custom_theme = $node->themekey_ui_theme;
     return 'static';
   }
@@ -121,7 +121,7 @@ function themekey_ui_author2theme($nid) {
   // node_load() must not be called from hook_init().
   // Therefore, we have to execute SQL here.
   if ($theme = db_result(db_query("SELECT theme FROM {node} JOIN {themekey_ui_author_theme} USING (uid) WHERE nid = %d", $nid))) {
-    if ('default' != $theme) {
+    if ('default' != $theme && themekey_check_theme_enabled($theme)) {
       $custom_theme = $theme;
       return 'static';
     }
