Index: trunk/ippScripts/scripts/detrend_process.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_process.pl	(revision 8862)
+++ trunk/ippScripts/scripts/detrend_process.pl	(revision 8983)
@@ -99,5 +99,10 @@
 	"-class_id $class_id -recip $recipe -uri $outputImage"; # Command to run dettool
     $command .= " -bg " . $stats->bg_mean();
-    $command .= " -bg_stdev " . $stats->bg_stdev();
+    if (defined($stats->bg_stdev())) {
+	$command .= " -bg_stdev " . $stats->bg_stdev();
+    } else {
+	# May be undefined if there's only a single imfile
+	$command .= " -bg_stdev 0";
+    }
     $command .= " -bg_mean_stdev " . $stats->bg_mean_stdev();
 
