Index: trunk/ippScripts/scripts/phase0_exp.pl
===================================================================
--- trunk/ippScripts/scripts/phase0_exp.pl	(revision 9502)
+++ trunk/ippScripts/scripts/phase0_exp.pl	(revision 9524)
@@ -100,5 +100,5 @@
 }
 my @backgrounds;                # Array of backgrounds
-my @stdevs;                        # Array of background standard deviations\
+my @variances;                        # Array of background standard deviations\
 my $obsType;                        # Observation type
   
@@ -124,5 +124,5 @@
     
     my $stdev = get_value($imfile, PHASE0_BG_MEAN_STDEV());
-    push @stdevs, $stdev;
+    push @variances, $stdev**2;
 }
 
@@ -147,15 +147,11 @@
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@backgrounds);
-	push @command, ( '-' . PHASE0_BG() ), $stats->mean(), ( '-' . PHASE0_BG_STDEV() );
-        if (scalar @backgrounds == 1) {
-	    push @command, 1;
-        } else {
-	    push @command, $stats->standard_deviation();
-        }
+	push @command, ( '-' . PHASE0_BG() ), $stats->mean();
+	push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
     }
     {
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
-        $stats->add_data(@stdevs);
-	push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), $stats->mean();
+        $stats->add_data(@variances);
+	push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );
     }
     
