Index: trunk/ippTasks/dist.pro
===================================================================
--- trunk/ippTasks/dist.pro	(revision 28777)
+++ trunk/ippTasks/dist.pro	(revision 28778)
@@ -147,6 +147,11 @@
         # to compute an index into the host table
         strlen $stage_id length
-        $start = $length - 2
-        substr $stage_id $start 2 index
+	if ($length >= 2) 
+	    $start = $length - 2
+	    substr $stage_id $start 2 index
+	else
+	    # stage_id < 10 caused a very annoying couple of hours for bills to debug
+	    substr $stage_id 0 1 index
+	end
         $component_id = $index % $count
         book getword ipphosts distribution $component_id -var myhost
@@ -411,6 +416,7 @@
 
     # using $DIST_ID as the "component" works fine here since we only look
-    # at the last two digits
-    set.dist.workdir.by.component $STAGE_ID "exposure" $OUTDIR_TEMPLATE OUTDIR 
+    # at the last two digits. But make sure that there 2 digits
+    $fake_component = $STAGE_ID + 10
+    set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR 
     if ("$OUTDIR" == "NULL")
         echo ERROR failed to set workdir for $DIST_ID
