diff --git a/gstlal-calibration/gst/lal/gstlal_matrixsolver.c b/gstlal-calibration/gst/lal/gstlal_matrixsolver.c
index 4466d06e2ed520b3e6735936a1ff5bc8b5dcc782..5743e1e4a46606f1cd3c689d9707cce1c1febfb8 100644
--- a/gstlal-calibration/gst/lal/gstlal_matrixsolver.c
+++ b/gstlal-calibration/gst/lal/gstlal_matrixsolver.c
@@ -199,11 +199,17 @@ static void solve_system_ ## COMPLEX ## DTYPE(const COMPLEX DTYPE *src, COMPLEX
  \
 		/* Now solve [matrix] [outvec] = [invec] for [outvec] using gsl */ \
 		gsl_linalg_ ## COMPLEX ## UNDERSCORE ## LU_decomp(matrix, permutation, &signum); \
-		gsl_linalg_ ## COMPLEX ## UNDERSCORE ## LU_solve(matrix, permutation, invec, outvec); \
+		if(!isinf(gsl_linalg_ ## COMPLEX ## UNDERSCORE ## LU_lndet(matrix))) { \
+			gsl_linalg_ ## COMPLEX ## UNDERSCORE ## LU_solve(matrix, permutation, invec, outvec); \
  \
-		/* Put the solutions into the output buffer */ \
-		for(j = 0; j < channels_out; j++) \
-			dst[i * channels_out + j] = get_ ## COMPLEX ## double_from_gsl_vector(outvec, j); \
+			/* Put the solutions into the output buffer */ \
+			for(j = 0; j < channels_out; j++) \
+				dst[i * channels_out + j] = get_ ## COMPLEX ## double_from_gsl_vector(outvec, j); \
+		} else { \
+			/* Fill output buffer with zeros */ \
+			for(j = 0; j < channels_out; j++) \
+				dst[i * channels_out + j] = 0.0; \
+		} \
 	} \
 }
 
diff --git a/gstlal-calibration/python/calibration_parts.py b/gstlal-calibration/python/calibration_parts.py
index 40725ad7de12c96b1ab4e6cb57a4e98af34df5ea..ee588135c3bd4a9d74001f7c8ad4a6b7fcb143af 100644
--- a/gstlal-calibration/python/calibration_parts.py
+++ b/gstlal-calibration/python/calibration_parts.py
@@ -403,7 +403,7 @@ def remove_lines_with_witnesses(pipeline, signal, witnesses, freqs, freq_vars, f
 			tfs_at_f = mkinterleave(pipeline, tfs_at_f, complex_data = True)
 			# It may be necessary to remove data at the beginning so that data that
 			# is missing do to filtering is not replaced with zeros
-			tfs_at_f = pipeparts.mkgeneric(pipeline, tfs_at_f, "lal_insertgap", bad_data_intervals = [-1e35, -1e-35, 1e-35, 1e35], replace_value = 1e-35, chop_length = 1000000000 * int(1 + (1 - filter_latency) * 21))
+			tfs_at_f = pipeparts.mkgeneric(pipeline, tfs_at_f, "lal_insertgap", chop_length = 1000000000 * int(1 + (1 - filter_latency) * 21))
 			tfs_at_f = pipeparts.mkgeneric(pipeline, tfs_at_f, "lal_matrixsolver")
 			tfs_at_f = mkdeinterleave(pipeline, tfs_at_f, len(witnesses[m]), complex_data = True)
 
diff --git a/gstlal-calibration/tests/check_calibration/Makefile b/gstlal-calibration/tests/check_calibration/Makefile
index f58323090cf8648a7f74aed583d05a27221708bf..a792fc6d27094df9c440191d1bcf54f2e202e3a0 100644
--- a/gstlal-calibration/tests/check_calibration/Makefile
+++ b/gstlal-calibration/tests/check_calibration/Makefile
@@ -18,8 +18,8 @@ END = $(shell echo 1234694144 + 4096 + 715 | bc)
 #1185771520
 SHMRUNTIME = 400
 # How much time does the calibration need to settle at the start and end?
-PLOT_WARMUP_TIME = 885
-PLOT_COOLDOWN_TIME = 4521
+PLOT_WARMUP_TIME = 715
+PLOT_COOLDOWN_TIME = 715
 
 GDSCONFIGS = Filters/ER14/GDSFilters/H1GDS_noisesub_test_1232874910.ini 
 DCSCONFIGS = Filters/ER13/GDSFilters/L1DCS_TEST_1231620000.ini
@@ -27,9 +27,10 @@ DCSCONFIGS = Filters/ER13/GDSFilters/L1DCS_TEST_1231620000.ini
 DCSFCCCONFIGS = ../../config_files/O2/H1/tests/H1DCS_FreqIndepAndFccCorrections_Cleaning.ini
 GDSTESTCONFIGS = ../../config_files/PreER13/H1/H1GDS_TEST_1225558818.ini
 DCSTESTCONFIGS = ../../config_files/O2/H1/tests/H1DCS_AllCorrections_Cleaning_TEST.ini
-GDSSHMCONFIGS = Filters/ER14/GDSFilters/L1GDS_1234630818_latency_test.ini
+GDSSHMCONFIGS = Filters/ER14/GDSFilters/H1GDS_1234630818_latency_test.ini
 
-all: noise_subtraction_ASD_GDS noise_subtraction_range_plots_GDS
+all: latency_test
+#noise_subtraction_ASD_GDS noise_subtraction_range_plots_GDS
 
 ###############################################
 ### These commands should change less often ###