Index: trunk/ippScripts/scripts/lap_science.pl
===================================================================
--- trunk/ippScripts/scripts/lap_science.pl	(revision 31515)
+++ trunk/ippScripts/scripts/lap_science.pl	(revision 31519)
@@ -460,7 +460,13 @@
 	my $companion;
 
-	if ($exposure->{pair_id}) { # Load companion exposure information
-	    if (exists($match_hash{$exposure->{chip_id}})) {
+	if ($exposure->{pairwise}) {
+            # Load companion exposure information
+	    if (($exposure->{pair_id})&&(exists($match_hash{$exposure->{chip_id}}))) {
 		$companion = ${ $exposures }[$match_hash{$exposure->{chip_id}}]; # Match!
+	    }
+	    else { # We claimed to be pairwise, but do not have a valid pair_id.
+		$exposure->{pairwise} = 0;
+		$exposure->{private} = 1;
+		&update_this_exposure($exposure);
 	    }
 	}
@@ -500,4 +506,5 @@
 	    $is_bad_quality = 1;
 	}
+	# If we've detected a bad quality exposure, drop it, and tell the companion.
 	if ($is_bad_quality) {
 	    unless ((defined($exposure->{diffRun_state}))&&
@@ -517,5 +524,5 @@
 
 	}
-
+	
 	if  ($exposure->{data_state} eq 'drop') { # This exposure is impossible, so fudge the counts so we get through.
 	    $can_qstack ++;
@@ -785,5 +792,5 @@
 	}
 	my $retry_command;
-	if ($exposure->{pairwise}) { # warpwarp
+	if (($exposure->{pairwise})&&(defined(${ $exposures }[$match_hash{$exposure->{chip_id}}]))) { # warpwarp
 	    my $companion = ${ $exposures }[$match_hash{$exposure->{chip_id}}];
 	    $command .= " -definewarpwarp ";
