diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index d80a490bf69425ef9d212e792f94aa7b1b669b67..9359b3a35b5273c54e36aec28c47101864480fea 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -609,7 +609,7 @@ run_permutation(TestSpec * testspec, int nsteps, Step ** steps)
 		if (!PQsendQuery(conn, step->sql))
 		{
 			fprintf(stdout, "failed to send query for step %s: %s\n",
-					step->name, PQerrorMessage(conns[1 + step->session]));
+					step->name, PQerrorMessage(conn));
 			exit_nicely();
 		}
 
@@ -739,7 +739,7 @@ try_complete_step(Step * step, int flags)
 			if (PQresultStatus(res) != PGRES_TUPLES_OK)
 			{
 				fprintf(stderr, "lock wait query failed: %s",
-						PQerrorMessage(conn));
+						PQerrorMessage(conns[0]));
 				exit_nicely();
 			}
 			ntuples = PQntuples(res);