diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c
index fda3442c5b..5a1e782f69 100644
--- a/src/backend/port/sysv_shmem.c
+++ b/src/backend/port/sysv_shmem.c
@@ -845,7 +845,6 @@ PGSharedMemoryReAttach(void)
 void
 PGSharedMemoryNoReAttach(void)
 {
-	Assert(UsedShmemSegAddr != NULL);
 	Assert(IsUnderPostmaster);
 
 #ifdef __CYGWIN__
diff --git a/src/backend/port/win32_shmem.c b/src/backend/port/win32_shmem.c
index ccd7b6b5e3..b486b61f26 100644
--- a/src/backend/port/win32_shmem.c
+++ b/src/backend/port/win32_shmem.c
@@ -448,8 +448,6 @@ PGSharedMemoryReAttach(void)
 void
 PGSharedMemoryNoReAttach(void)
 {
-	Assert(ShmemProtectiveRegion != NULL);
-	Assert(UsedShmemSegAddr != NULL);
 	Assert(IsUnderPostmaster);
 
 	/*
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 34315b8d1a..42d835c359 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -993,6 +993,15 @@ PostmasterMain(int argc, char *argv[])
 	 */
 	InitializeMaxBackends();
 
+	/*
+	 * In EXEC_BACKEND case there is a pgsql_tmp directory at the top level of
+	 * DataDir as well.  This needs to happen before starting the syslogger as
+	 * it could try to read some entries removed here.
+	 */
+#ifdef EXEC_BACKEND
+	RemovePgTempFilesInDir(PG_TEMP_FILES_DIR, true, false);
+#endif
+
 	/*
 	 * Initialize pipe (or process handle on Windows) that allows children to
 	 * wake up from sleep on postmaster death.
@@ -1298,6 +1307,9 @@ PostmasterMain(int argc, char *argv[])
 	/*
 	 * Remove old temporary files.  At this point there can be no other
 	 * Postgres processes running in this directory, so this should be safe.
+	 * The syslogger touches no temporary files except the ones in the root
+	 * of the data folder, so it is safe if the syslogger has already
+	 * started.
 	 */
 	RemovePgTempFiles();
 
@@ -4700,8 +4712,17 @@ retry:
 	 * is active then it might sometimes fail due to the stack or heap having
 	 * gotten mapped into that range.  In that case, just terminate the
 	 * process and retry.
+	 *
+	 * Some processes do not use shared memory, so they don't need to reserve
+	 * a shared memory region.  This check needs to be kept in sync with
+	 * SubPostmasterMain().
 	 */
-	if (!pgwin32_ReserveSharedMemoryRegion(pi.hProcess))
+	if ((strcmp(argv[1], "--forkbackend") == 0 ||
+		 strcmp(argv[1], "--forkavlauncher") == 0 ||
+		 strcmp(argv[1], "--forkavworker") == 0 ||
+		 strcmp(argv[1], "--forkboot") == 0 ||
+		 strncmp(argv[1], "--forkbgworker=", 15) == 0) &&
+		!pgwin32_ReserveSharedMemoryRegion(pi.hProcess))
 	{
 		/* pgwin32_ReserveSharedMemoryRegion already made a log entry */
 		if (!TerminateProcess(pi.hProcess, 255))
@@ -4847,6 +4868,9 @@ SubPostmasterMain(int argc, char *argv[])
 	 * child process's memory map to be different from the parent's, making it
 	 * sometimes impossible to attach to shared memory at the desired address.
 	 * Return the setting to its old value (usually '1' or '2') when finished.
+	 *
+	 * This check needs to be kept in sync with what is done in
+	 * internal_forkexec().
 	 */
 	if (strcmp(argv[1], "--forkbackend") == 0 ||
 		strcmp(argv[1], "--forkavlauncher") == 0 ||
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index fdac9850e0..9e0000ff89 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -307,8 +307,6 @@ static int	FreeDesc(AllocateDesc *desc);
 
 static void AtProcExit_Files(int code, Datum arg);
 static void CleanupTempFiles(bool isCommit, bool isProcExit);
-static void RemovePgTempFilesInDir(const char *tmpdirname, bool missing_ok,
-					   bool unlink_all);
 static void RemovePgTempRelationFiles(const char *tsdirname);
 static void RemovePgTempRelationFilesInDbspace(const char *dbspacedirname);
 
@@ -2920,14 +2918,6 @@ RemovePgTempFiles(void)
 	}
 
 	FreeDir(spc_dir);
-
-	/*
-	 * In EXEC_BACKEND case there is a pgsql_tmp directory at the top level of
-	 * DataDir as well.
-	 */
-#ifdef EXEC_BACKEND
-	RemovePgTempFilesInDir(PG_TEMP_FILES_DIR, true, false);
-#endif
 }
 
 /*
@@ -2945,7 +2935,7 @@ RemovePgTempFiles(void)
  * (These two flags could be replaced by one, but it seems clearer to keep
  * them separate.)
  */
-static void
+void
 RemovePgTempFilesInDir(const char *tmpdirname, bool missing_ok, bool unlink_all)
 {
 	DIR		   *temp_dir;
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 5ee5e09ddf..33ca03f2f5 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -422,7 +422,7 @@
 					# requires logging_collector to be on.
 
 # This is used when logging to stderr:
-#logging_collector = off		# Enable capturing of stderr and csvlog
+logging_collector = on		# Enable capturing of stderr and csvlog
 					# into log files. Required to be on for
 					# csvlogs.
 					# (change requires restart)
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index a03b4d14a2..952fe71dff 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -135,6 +135,8 @@ extern void AtEOXact_Files(bool isCommit);
 extern void AtEOSubXact_Files(bool isCommit, SubTransactionId mySubid,
 				  SubTransactionId parentSubid);
 extern void RemovePgTempFiles(void);
+extern void RemovePgTempFilesInDir(const char *tmpdirname, bool missing_ok,
+								   bool unlink_all);
 extern bool looks_like_temp_rel_name(const char *name);
 
 extern int	pg_fsync(int fd);
diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl
index d7a9fc5039..de070e26e5 100644
--- a/src/tools/msvc/config_default.pl
+++ b/src/tools/msvc/config_default.pl
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 our $config = {
-	asserts => 0,    # --enable-cassert
+	asserts => 1,    # --enable-cassert
 	     # float4byval=>1,         # --disable-float4-byval, on by default
 
 	# float8byval=> $platformbits == 64, # --disable-float8-byval,
@@ -17,7 +17,7 @@ our $config = {
 	gss       => undef,    # --with-gssapi=<path>
 	icu       => undef,    # --with-icu=<path>
 	nls       => undef,    # --enable-nls=<path>
-	tap_tests => undef,    # --enable-tap-tests
+	tap_tests => 1,    # --enable-tap-tests
 	tcl       => undef,    # --with-tcl=<path>
 	perl      => undef,    # --with-perl
 	python    => undef,    # --with-python=<path>
