diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index f502a2e3c7..0cd510eeea 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -48,7 +48,7 @@ ok(!-d "$tempdir/backup", 'backup directory was cleaned up');
 # but leave the data directory behind
 mkdir("$tempdir/backup")
 	or BAIL_OUT("unable to create $tempdir/backup");
-append_to_file("$tempdir/backup/dir-not-empty.txt");
+append_to_file("$tempdir/backup/dir-not-empty.txt", "Some data");
 
 $node->command_fails([ 'pg_basebackup', '-D', "$tempdir/backup", '-n' ],
 	'failing run with no-clean option');
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 1bd91524d7..5a8f084efe 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1541,7 +1541,7 @@ sub wait_for_catchup
 	  . $standby_name . "'s "
 	  . $mode
 	  . "_lsn to pass "
-	  . $target_lsn . " on "
+	  . $lsn_expr . " on "
 	  . $self->name . "\n";
 	my $query =
 qq[SELECT $lsn_expr <= ${mode}_lsn FROM pg_catalog.pg_stat_replication WHERE application_name = '$standby_name';];
