Index: sections.module
===================================================================
--- sections.module	(revision 289)
+++ sections.module	(working copy)
@@ -171,6 +171,8 @@
  * Implementation of hook_init().
  */
 function sections_init() {
+  global $sections_section;
+  
   // If node specific theme is configured, switch to that theme.
   if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) {
     $node = node_load(arg(1));  
@@ -180,8 +182,8 @@
     }
   }
   // Otherwise, see if one of the defined sections matches.
-  if ($section = _sections_in_section()) {
-    _sections_switch_theme($section->theme);
+  if ($sections_section = _sections_in_section()) {
+    _sections_switch_theme($sections_section->theme);
   }
 }
 
@@ -283,16 +285,18 @@
  * Implementation of hook_preprocess().
  */
 function sections_preprocess(&$variables, $hook) {
+  global $sections_section;
+  
   // Are we in a section?
-  if ($section = _sections_in_section()) {
+  if ($sections_section) {
     // Clean up the section names for template file names.
     $filter = '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s';
-    $name_clean = preg_replace($filter, '-', drupal_strtolower($section->name));
+    $name_clean = preg_replace($filter, '-', drupal_strtolower($sections_section->name));
 
     // Add some section information to all preprocess hooks.
     $variables['section'] = array(
-      'sid' => $section->sid,
-      'theme' => $section->theme,
+      'sid' => $sections_section->sid,
+      'theme' => $sections_section->theme,
       'name_clean' => $name_clean,
     );
 
@@ -300,23 +304,24 @@
       case 'page':
         // Add template suggestions for page templates.
         $variables['template_files'][] = 'page-sections';
-        $variables['template_files'][] = 'page-sections-'. $section->sid;
+        $variables['template_files'][] = 'page-sections-'. $sections_section->sid;
         $variables['template_files'][] = 'page-sections-'. $name_clean;
         break;
 
       case 'node':
         // Add template suggestions for node templates.
         $variables['template_files'][] = 'node-sections';
-        $variables['template_files'][] = 'node-sections-'. $section->sid;
+        $variables['template_files'][] = 'node-sections-'. $sections_section->sid;
         $variables['template_files'][] = 'node-sections-'. $name_clean;
         break;
 
       case 'block':
         // Add template suggestions for block templates.
         $variables['template_files'][] = 'block-sections';
-        $variables['template_files'][] = 'block-sections-'. $section->sid;
+        $variables['template_files'][] = 'block-sections-'. $sections_section->sid;
         $variables['template_files'][] = 'block-sections-'. $name_clean;
         break;
     }
   }
 }
+
