Index: trunk/ippScripts/scripts/nightly_science.pl
===================================================================
--- trunk/ippScripts/scripts/nightly_science.pl	(revision 30132)
+++ trunk/ippScripts/scripts/nightly_science.pl	(revision 30261)
@@ -1099,4 +1099,5 @@
     my $Npotential = 0;
     my $Nqueued = 0;
+    my $is_processing = 0;
     foreach my $target (sort (keys %science_config)) {
 	if ($science_config{$target}{STACKABLE} == 1) {
@@ -1107,4 +1108,5 @@
 			print STDERR "execute_stacks: Target $target on $date is not fully processed. ($NprocChips $NprocWarps)\n";
 		    }
+		    $is_processing = 1;
                     $metadata_out{nsStackState} = 'FORCETOWARP';
                     next;
@@ -1159,5 +1161,5 @@
     $metadata_out{nsStackPotential} = $Npotential;
     $metadata_out{nsStackQueued}    = $Nqueued;
-    if (($Npotential == $Nqueued)&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')) {
+    if (($Npotential == $Nqueued)&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')&&($is_processing == 0)) {
 	$metadata_out{nsStackState} = 'FINISHED_STACKS';
     }	
@@ -1291,4 +1293,5 @@
     my $Npotential = 0;
     my $Nnoexp     = 0;
+    my $is_processing = 0;
     foreach my $target (sort (keys %science_config)) {
 	if ($science_config{$target}{DIFFABLE} == 1) {
@@ -1296,11 +1299,10 @@
 		$Npotential ++;
 		my ($NprocChips,$NprocWarps) = pre_diff_queue($date,$observing_state,$target,$filter);
-# 		if ((!defined($force_diff_count))&&($NprocChips != $NprocWarps)) {
-# 		    if ($debug == 1) {
-# 			print STDERR "execute_diffs: Target $target in filter $filter on $date is not fully processed. ($NprocChips $NprocWarps)\n";
-# 		    }
-#                     $metadata_out{nsDiffState} = 'FORCETOWARP';
-#                     next;
-#                 }
+		if ((!defined($force_diff_count))&&($NprocChips != $NprocWarps)) {
+		    if ($debug == 1) {
+			print STDERR "execute_diffs: Target $target in filter $filter on $date is not fully processed. ($NprocChips $NprocWarps)\n";
+		    }
+		    $is_processing = 1;
+		}
                 if ($NprocChips == 0) {
 		    $Nnoexp ++;
@@ -1332,5 +1334,5 @@
         }
     }
-    if (($Npotential == $Nnoexp)&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')) {
+    if (($Npotential == $Nnoexp)&&($metadata_out{nsObservingState} eq 'END_OF_NIGHT')&&($is_processing == 0)) {
 	$metadata_out{nsDiffState} = 'FINISHED_DIFFS';
     }	
