Index: trunk/ippScripts/scripts/detrend_norm_exp.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 17241)
+++ trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 17250)
@@ -48,5 +48,5 @@
 	   'no-op'             => \$no_op,
 	   ) or pod2usage( 2 );
-
+$verbose = 1;
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage( -msg => "Required options: --det_id --iteration --camera --det_type --outroot",
@@ -186,5 +186,6 @@
 	my $command = "$dettool -addprocessedimfile";
 	$command .= " -det_id $det_id";
-	$command .= " -iter $iter";
+# this option seems to have been removed
+#	$command .= " -iter $iter";
 	$command .= " -code $exit_code";
 	$command .= " -dbname $dbname" if defined $dbname;
Index: trunk/ippScripts/scripts/detrend_stack.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_stack.pl	(revision 17241)
+++ trunk/ippScripts/scripts/detrend_stack.pl	(revision 17250)
@@ -81,4 +81,13 @@
 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
 
+# Look for programs we need
+my $missing_tools;
+my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
+my $ppMerge = can_run('ppMerge') or (warn "Can't find ppMerge" and $missing_tools = 1);
+if ($missing_tools) { 
+    warn("Can't find required tools.");
+    exit($PS_EXIT_CONFIG_ERROR); 
+}
+
 # The output file rule name depends on the detrend type
 my $FILERULES = { 'FLATMASK' => 'PPMERGE.OUTPUT.MASK',
@@ -96,12 +105,4 @@
 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless defined $output_filerule;
 
-# Look for programs we need
-my $missing_tools;
-my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
-my $ppMerge = can_run('ppMerge') or (warn "Can't find ppMerge" and $missing_tools = 1);
-if ($missing_tools) { 
-    warn("Can't find required tools.");
-    exit($PS_EXIT_CONFIG_ERROR); 
-}
 
 # Get list of files to stack
