Index: trunk/ippScripts/scripts/detrend_process.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_process.pl	(revision 8358)
+++ trunk/ippScripts/scripts/detrend_process.pl	(revision 8490)
@@ -42,5 +42,5 @@
 
 ### Output file name --- must match camera configuration!
-my $outputFile = $output . "." . $classId . ".fit";
+my $outputName = $output . "." . $classId . ".fit";
 
 # Run ppImage
@@ -51,5 +51,5 @@
 	run(command => $command, verbose => 1);
     die "Unable to perform ppImage on $input: $error_code\n" if not $success;
-    die "Couldn't find expected output file: $outputFile\n" if not -f $outputFile;
+    die "Couldn't find expected output file: $outputName\n" if not -f $outputName;
 }
 
@@ -58,5 +58,5 @@
 {
     my $statsFile;		# File handle
-    open $statsFile, "$output.stats";
+    open $statsFile, "$output.stats" or die "Can't open statistics file $output.stats: $!\n";
     my @contents = <$statsFile>; # Contents of file
     close $statsFile;
@@ -70,5 +70,5 @@
 {
     my $command = "dettool -addprocessed -det_id $detId -exp_id $expId " .
-	"-class_id $classId -recipe $recipe -uri $outputFile"; # Command to run dettool
+	"-class_id $classId -recipe $recipe -uri $outputName"; # Command to run dettool
     $command .= " -bg " . $stats->bg_mean();
     $command .= " -bg_stdev " . $stats->bg_stdev();
