Index: trunk/pstamp/scripts/pstamp_job_run.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_job_run.pl	(revision 33126)
+++ trunk/pstamp/scripts/pstamp_job_run.pl	(revision 33141)
@@ -306,5 +306,6 @@
     # Load the argument list that dqueryparse should have created the first time it ran, so we know how to
     # run it again the same way.
-    my $argslist = "$outputBase/parse.args";
+    my $outdir = dirname($outputBase);
+    my $argslist = "$outdir/parse.args";
     open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     my $argString = <ARGSLIST>;
@@ -319,4 +320,5 @@
     $command .= " --dbserver $dbserver" if $dbserver;
     $command .= " --verbose" if $verbose;
+    $command .= " --save-temps" if $save_temps;
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => $verbose);
@@ -616,4 +618,8 @@
 
     $exit_code = $PS_EXIT_PROG_ERROR unless $exit_code;
+    if ($exit_code > 100) {
+        carp ("invalid exit code: $exit_code changing to $PS_EXIT_UNKNOWN_ERROR");
+        $exit_code = $PS_EXIT_UNKNOWN_ERROR;
+    }
     $job_state = 'run' unless $job_state;
 
