Index: joomla.module
===================================================================
--- joomla.module	(revision 24)
+++ joomla.module	(working copy)
@@ -523,12 +523,12 @@
       $joomla_section->vid = $vocabulary->vid;
       $joomla_section->jsectionid = $section->id;
 
-      // Also, store this in a map for use when importing categories
-      $section_vocabulary_map[$section->id] = $vocabulary->vid;
-
       drupal_write_record('joomla_sections', $joomla_section);
     }
 
+    // Also, store this in a map for use when importing categories
+    $section_vocabulary_map[$section->id] = $vocabulary->vid;
+
     switch ($res) {
 
       case SAVED_NEW:
@@ -564,6 +564,10 @@
   $categories = db_query("SELECT id,title,name,section,ordering FROM %s.%scategories", $joomla_database, $joomla_prefix);
 
   while ($category = db_fetch_object($categories)) {
+    // We have some sections that are non-integers. Ignore those.
+    if ($category->section <= 0) {
+      continue;
+    }
     $categories_total++;
 
     db_set_active();
