diff --git a/Makefile.in b/Makefile.in
index 3ab1bd1..467170e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -145,15 +145,15 @@ install-root:
 	$(INSTALL) -m 644 $(MAP).sample $(DESTDIR)$(ROOT)/gophermap
 
 install-inetd-update: install-root
-	update-inetd --add "$$(sed -e "s:@BINARY_PATH@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in)"
+	update-inetd --add "$$(sed -e "s:@BINARY_PATH@:$(SBINDIR)/$(BINARY):g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in)"
 	update-inetd --enable gopher
 
 install-inetd-manual: install-root
-	sed -e "s:@BINARY_PATH@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in >> $(DESTDIR)$(INETD)
+	sed -e "s:@BINARY_PATH@:$(SBINDIR)/$(BINARY):g" -e "s/@OPTIONS@/$(INETOPT)/g" init/inetlin.in >> $(DESTDIR)$(INETD)
 
 install-xinetd: install-root
 	$(INSTALL) -d -m 755 $(DESTDIR)/etc/xinetd.d
-	sed -i -e "s:@BINARY@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" init/$(NAME).xinetd
+	sed -i -e "s:@BINARY@:$(SBINDIR)/$(BINARY):g" init/$(NAME).xinetd
 	$(INSTALL) -m 644 -T init/$(NAME).xinetd $(DESTDIR)$(XINETD)
 
 install-osx: install-root
@@ -172,7 +172,7 @@ install-systemd: install-root
 	$(INSTALL) -m 644 -T init/$(NAME).env $(DESTDIR)$(DEFAULT)/$(NAME)
 	$(INSTALL) -d -m 755 $(DESTDIR)$(SYSTEMD)
 	$(INSTALL) -m 644 -t $(DESTDIR)$(SYSTEMD) init/$(NAME).socket
-	sed -i -e "s:@BINARY@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" init/$(NAME)\@.service
+	sed -i -e "s:@BINARY@:$(SBINDIR)/$(BINARY):g" init/$(NAME)\@.service
 	$(INSTALL) -m 644 -t $(DESTDIR)$(SYSTEMD) init/$(NAME)\@.service
 
 uninstall: @UNINSTALL_INETD_UPDATE@ @UNINSTALL_INETD_MANUAL@ @UNINSTALL_XINETD@ @UNINSTALL_OSX@ @UNINSTALL_SYSTEMD@
diff --git a/README.md b/README.md
index 6334f6e..7ec5645 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ daemon. It is licensed under the BSD license.
 
 Developers can be reached at gophernicus AT gophernicus DOT org.
 
-Our IRC channel is on irc.freenode.net #gophernicus.
+Our IRC channel is on irc.libera.chat #gophernicus.
 
 You most likely want to subscribe to the gophernicus mailing list at
 https://lists.tildeverse.org/postorius/lists/gophernicus.lists.tildeverse.org/,
diff --git a/debian/changelog b/debian/changelog
index 42b9fac..29333b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gophernicus (3.1.1+git20220122.1.da33900-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * Drop patch 03_do_not_hardcode_build_path.diff, present upstream.
+  * Drop patch 09_readme_irc.diff, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sat, 28 May 2022 11:19:11 -0000
+
 gophernicus (3.1.1-3) unstable; urgency=low
 
   * Explain the use of /srv/gopher instead of /var/gopher in README.Debian
diff --git a/debian/patches/01_xinetd_defaults.diff b/debian/patches/01_xinetd_defaults.diff
index 559b932..59ad2a7 100644
--- a/debian/patches/01_xinetd_defaults.diff
+++ b/debian/patches/01_xinetd_defaults.diff
@@ -7,9 +7,9 @@ Last-Update: 2020-05-17
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 Index: gophernicus/init/gophernicus.xinetd.in
 ===================================================================
---- gophernicus.orig/init/gophernicus.xinetd.in	2021-01-02 22:12:50.306022653 -0500
-+++ gophernicus/init/gophernicus.xinetd.in	2021-01-02 22:12:50.306022653 -0500
-@@ -6,6 +6,6 @@
+--- gophernicus.orig/init/gophernicus.xinetd.in
++++ gophernicus/init/gophernicus.xinetd.in
+@@ -6,6 +6,6 @@ service gopher
  	wait		= no
  	user		= nobody
  	server		= @BINARY@
diff --git a/debian/patches/02_do_not_hardcode_hostname.diff b/debian/patches/02_do_not_hardcode_hostname.diff
index 14f2086..9783303 100644
--- a/debian/patches/02_do_not_hardcode_hostname.diff
+++ b/debian/patches/02_do_not_hardcode_hostname.diff
@@ -7,9 +7,9 @@ Last-Update: 2021-01-02
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 Index: gophernicus/init/gophernicus.xinetd.in
 ===================================================================
---- gophernicus.orig/init/gophernicus.xinetd.in	2021-01-02 22:07:38.233810261 -0500
-+++ gophernicus/init/gophernicus.xinetd.in	2021-01-02 22:07:38.229810618 -0500
-@@ -6,6 +6,6 @@
+--- gophernicus.orig/init/gophernicus.xinetd.in
++++ gophernicus/init/gophernicus.xinetd.in
+@@ -6,6 +6,6 @@ service gopher
  	wait		= no
  	user		= nobody
  	server		= @BINARY@
@@ -19,8 +19,8 @@ Index: gophernicus/init/gophernicus.xinetd.in
  }
 Index: gophernicus/init/gophernicus.env.in
 ===================================================================
---- gophernicus.orig/init/gophernicus.env.in	2021-01-02 17:52:48.421732954 -0500
-+++ gophernicus/init/gophernicus.env.in	2021-01-02 22:07:58.915968676 -0500
+--- gophernicus.orig/init/gophernicus.env.in
++++ gophernicus/init/gophernicus.env.in
 @@ -7,4 +7,4 @@
  # OPTIONS="-h full.hostname -D \"I find your lack of gopher disturbing.\""
  #
diff --git a/debian/patches/03_do_not_hardcode_build_path.diff b/debian/patches/03_do_not_hardcode_build_path.diff
deleted file mode 100644
index b0fb3a5..0000000
--- a/debian/patches/03_do_not_hardcode_build_path.diff
+++ /dev/null
@@ -1,29 +0,0 @@
-Description: Do not include build directory paths in installed files
-Author: Ryan Kavanagh <rak@debian.org>
-Origin: Debian
-Forwarded: no
-Last-Update: 2021-01-02
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: gophernicus/Makefile.in
-===================================================================
---- gophernicus.orig/Makefile.in	2021-01-02 22:35:28.000000000 -0500
-+++ gophernicus/Makefile.in	2021-01-02 22:39:14.616952066 -0500
-@@ -153,7 +153,7 @@
- 
- install-xinetd: install-root
- 	$(INSTALL) -d -m 755 $(DESTDIR)/etc/xinetd.d
--	sed -i -e "s:@BINARY@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" init/$(NAME).xinetd
-+	sed -i -e "s:@BINARY@:$(SBINDIR)/$(BINARY):g" init/$(NAME).xinetd
- 	$(INSTALL) -m 644 -T init/$(NAME).xinetd $(DESTDIR)$(XINETD)
- 
- install-osx: install-root
-@@ -172,7 +172,7 @@
- 	$(INSTALL) -m 644 -T init/$(NAME).env $(DESTDIR)$(DEFAULT)/$(NAME)
- 	$(INSTALL) -d -m 755 $(DESTDIR)$(SYSTEMD)
- 	$(INSTALL) -m 644 -t $(DESTDIR)$(SYSTEMD) init/$(NAME).socket
--	sed -i -e "s:@BINARY@:$(DESTDIR)$(SBINDIR)/$(BINARY):g" init/$(NAME)\@.service
-+	sed -i -e "s:@BINARY@:$(SBINDIR)/$(BINARY):g" init/$(NAME)\@.service
- 	$(INSTALL) -m 644 -t $(DESTDIR)$(SYSTEMD) init/$(NAME)\@.service
- 
- uninstall: @UNINSTALL_INETD_UPDATE@ @UNINSTALL_INETD_MANUAL@ @UNINSTALL_XINETD@ @UNINSTALL_OSX@ @UNINSTALL_SYSTEMD@
diff --git a/debian/patches/06_systemd_documentation.diff b/debian/patches/06_systemd_documentation.diff
index 5aec7db..a9e2dad 100644
--- a/debian/patches/06_systemd_documentation.diff
+++ b/debian/patches/06_systemd_documentation.diff
@@ -7,8 +7,8 @@ Last-Update: 2020-05-17
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 Index: gophernicus/init/gophernicus.socket
 ===================================================================
---- gophernicus.orig/init/gophernicus.socket	2021-01-02 22:19:00.521057882 -0500
-+++ gophernicus/init/gophernicus.socket	2021-01-02 22:19:00.521057882 -0500
+--- gophernicus.orig/init/gophernicus.socket
++++ gophernicus/init/gophernicus.socket
 @@ -1,5 +1,6 @@
  [Unit]
  Description=Gophernicus gopher server
@@ -18,8 +18,8 @@ Index: gophernicus/init/gophernicus.socket
  ListenStream=70
 Index: gophernicus/init/gophernicus@.service.in
 ===================================================================
---- gophernicus.orig/init/gophernicus@.service.in	2021-01-02 22:11:41.756126491 -0500
-+++ gophernicus/init/gophernicus@.service.in	2021-01-02 22:19:22.087137592 -0500
+--- gophernicus.orig/init/gophernicus@.service.in
++++ gophernicus/init/gophernicus@.service.in
 @@ -1,5 +1,6 @@
  [Unit]
  Description=Gophernicus gopher server
diff --git a/debian/patches/07_buildflags.diff b/debian/patches/07_buildflags.diff
index 8aff022..62397a9 100644
--- a/debian/patches/07_buildflags.diff
+++ b/debian/patches/07_buildflags.diff
@@ -7,9 +7,9 @@ Last-Update: 2021-01-02
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 Index: gophernicus/Makefile.in
 ===================================================================
---- gophernicus.orig/Makefile.in	2021-01-02 22:13:52.968443050 -0500
-+++ gophernicus/Makefile.in	2021-01-02 22:13:52.968443050 -0500
-@@ -36,7 +36,7 @@
+--- gophernicus.orig/Makefile.in
++++ gophernicus/Makefile.in
+@@ -36,7 +36,7 @@ SYSTEMD  = @SYSTEMD@
  
  CC      ?= @CC@
  HOSTCC  ?= @HOSTCC@
diff --git a/debian/patches/08_no_systemd_nobody.diff b/debian/patches/08_no_systemd_nobody.diff
index 27a2030..c0b924b 100644
--- a/debian/patches/08_no_systemd_nobody.diff
+++ b/debian/patches/08_no_systemd_nobody.diff
@@ -10,9 +10,9 @@ Last-Update: 2021-01-02
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 Index: gophernicus/init/gophernicus@.service.in
 ===================================================================
---- gophernicus.orig/init/gophernicus@.service.in	2021-01-03 08:58:12.001053045 -0500
-+++ gophernicus/init/gophernicus@.service.in	2021-01-03 08:58:11.997051401 -0500
-@@ -8,4 +8,4 @@
+--- gophernicus.orig/init/gophernicus@.service.in
++++ gophernicus/init/gophernicus@.service.in
+@@ -8,4 +8,4 @@ EnvironmentFile=-@SYSCONFIG@/gophernicus
  ExecStart=@BINARY@ $OPTIONS
  SuccessExitStatus=1
  StandardInput=socket
@@ -20,9 +20,9 @@ Index: gophernicus/init/gophernicus@.service.in
 +User=_gophernicus
 Index: gophernicus/init/gophernicus.xinetd.in
 ===================================================================
---- gophernicus.orig/init/gophernicus.xinetd.in	2021-01-03 08:58:12.001053045 -0500
-+++ gophernicus/init/gophernicus.xinetd.in	2021-01-03 08:58:11.997051401 -0500
-@@ -4,7 +4,7 @@
+--- gophernicus.orig/init/gophernicus.xinetd.in
++++ gophernicus/init/gophernicus.xinetd.in
+@@ -4,7 +4,7 @@ service gopher
  {
  	socket_type	= stream
  	wait		= no
diff --git a/debian/patches/09_readme_irc.diff b/debian/patches/09_readme_irc.diff
deleted file mode 100644
index b3fbc58..0000000
--- a/debian/patches/09_readme_irc.diff
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: Update upstream IRC channel in README
-Origin: upstream, https://github.com/gophernicus/gophernicus/commit/2d3182ac6375c7e0995ae14082f205b357633edb
-Last-Update: 2021-05-28
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: gophernicus/README.md
-===================================================================
---- gophernicus.orig/README.md	2021-01-02 22:11:41.756126491 -0500
-+++ gophernicus/README.md	2021-05-28 10:40:37.892642643 -0400
-@@ -16,7 +16,7 @@
- 
- Developers can be reached at gophernicus AT gophernicus DOT org.
- 
--Our IRC channel is on irc.freenode.net #gophernicus.
-+Our IRC channel is on irc.libera.chat #gophernicus.
- 
- You most likely want to subscribe to the gophernicus mailing list at
- https://lists.tildeverse.org/postorius/lists/gophernicus.lists.tildeverse.org/,
diff --git a/debian/patches/series b/debian/patches/series
index d1e155a..49a6f63 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,5 @@
 01_xinetd_defaults.diff
 02_do_not_hardcode_hostname.diff
-03_do_not_hardcode_build_path.diff
 06_systemd_documentation.diff
 07_buildflags.diff
 08_no_systemd_nobody.diff
-09_readme_irc.diff
diff --git a/gophernicus.8 b/gophernicus.8
index 29dd864..f60c545 100644
--- a/gophernicus.8
+++ b/gophernicus.8
@@ -1,5 +1,5 @@
 .Dd April 13, 2020
-.Dt GOPHERNICUS 1
+.Dt GOPHERNICUS 8
 .Os
 .Sh NAME
 .Nm gophernicus
@@ -47,11 +47,12 @@
 .Op Fl \&?
 .Sh DESCRIPTION
 .Nm
-is a gopher server. It serves almost compliant RFC 1436, with small
-changes to make it more modern.
+is a gopher server.
+It serves almost compliant RFC 1436, with small changes to make it more
+modern.
 .Nm
-supports userdirs, executable gophermaps, CGI, and virtual hosting (in the
-limits of the RFC).
+supports userdirs, executable gophermaps, CGI, and virtual hosting
+.Pq in the limits of the RFC .
 .Pp
 .Nm
 can log to
@@ -65,21 +66,17 @@ Changes the server hostname shown on the output menu.
 The default is the fully qualified domain name of the machine.
 .It Fl p Ar port
 Changes the server port shown on the output menu.
-The default is
-.Pa 70 .
+The default is 70.
 .It Fl T Ar port
 Changes the SSL/TLS port.
-The default is
-.Pa 0
-(disabled).
+The default is 0 (disabled).
 .It Fl r Ar directory
 Set the document root of the server.
 The default is
 .Pa /var/gopher .
 .It Fl t Ar type
 Set the default gopher filetype.
-The default is
-.Pa 0 .
+The default is 0.
 .It Fl g Ar mapfile
 Set the gophermap file name.
 The default is
@@ -94,21 +91,22 @@ The default is
 .Pa /cgi-bin/ .
 .It Fl u Ar directory
 Set the name of the personal gopherspace directory.
-Each user can deploy a personal gopherspace by creating a directory
-.Pa directory
+Each user can deploy a personal gopherspace by creating
+.Ar directory
 in their home directory.
 The default is
 .Pa public_gopher .
 .It Fl l Ar file
 Log to
-.Pa file
-in Apache-compatible combined format. Disabled by default.
+.Ar file
+in Apache-compatible combined format.
+Disabled by default.
 .It Fl w Ar width
 Set default page width.
-The default is
-.Pa 67 .
+The default is 67.
 .It Fl o Ar charset
-Select the output charset. It can be
+Select the output charset.
+It can be one of
 .Ar UTF-8 ,
 .Ar US-ASCII ,
 or
@@ -117,17 +115,13 @@ The default is
 .Ar UTF-8 .
 .It Fl s Ar seconds
 Session timeout in seconds.
-The default is
-.Pa 1800 .
+The default is 1800.
 .It Fl i Ar hits
 Maximum hits until throttling.
-The default is
-.Pa 4069 .
+The default is 4069.
 .It Fl k Ar kilobytes
 Maximum transfer size in KiB until throttling.
-The default is
-.Pa 4194304
-(4 GiB).
+The default is 4194304 (4 GiB).
 .It Fl f Ar directory
 Set directory where output filters are found.
 Disabled by default.
@@ -156,7 +150,8 @@ Set the email of the administrator to appear in
 .It Fl U Ar paths
 Set a colon-separated list of extra
 .Xr unveil 2
-paths (only for OpenBSD).
+paths
+.Pq only for Ox .
 .It Fl nv
 Disable virtual hosting.
 .It Fl nl
@@ -193,6 +188,8 @@ By default,
 will refuse to run as root.
 .It Fl np
 Disable HAProxy proxy protocol.
+.It Fl nu
+Disable personal gopherspaces.
 .It Fl nx
 Disable execution of gophermaps and scripts.
 .It Fl nH
@@ -223,7 +220,7 @@ mostly conforms to
 .Lk https://tools.ietf.org/html/rfc1436 "RFC 1436"
 .Sh AUTHORS
 .An -nosplit
-.An Kim Holviala.
+.An Kim Holviala
 wrote the original implementation (2009\(en2018).
 .Pp
 .An fosslinux
@@ -247,7 +244,7 @@ Copyright \(co
 2009\(en2018.
 .Pp
 Copyright \(co
-.An Nm gophernicus Ns \& developers
+.An gophernicus developers
 2019.
 .Pp
 Licensed to you under the terms of the BSD 2-clause license.
diff --git a/src/gophernicus.c b/src/gophernicus.c
index 250d917..0cf2d68 100644
--- a/src/gophernicus.c
+++ b/src/gophernicus.c
@@ -248,7 +248,7 @@ static void selector_to_path(state *st)
 
 		/* Check ~public_gopher access rights */
 		if (stat(st->req_realpath, &file) == ERROR)
-			die(st, ERR_NOTFOUND, NULL);
+			die(st, st->req_selector, ERR_NOTFOUND);
 		if ((file.st_mode & S_IROTH) == 0)
 			die(st, ERR_ACCESS, "~/public_gopher not world-readable");
 		if (file.st_uid != pwd->pw_uid)
@@ -270,7 +270,8 @@ static void selector_to_path(state *st)
 		if (stat(st->req_realpath, &file) == OK) return;
 
 		/* Loop through all vhosts looking for the selector */
-		if ((dp = opendir(st->server_root)) == NULL) die(st, ERR_NOTFOUND, NULL);
+		if ((dp = opendir(st->server_root)) == NULL)
+			die(st, st->req_selector, ERR_NOTFOUND);
 		while ((dir = readdir(dp))) {
 
 			/* Skip .hidden dirs and . & .. */
@@ -529,10 +530,10 @@ int main(int argc, char *argv[])
 
 	/* Convert relative gopher roots to absolute roots */
 	if (st.server_root[0] != '/') {
-		char cwd[512];
-		getcwd(cwd, sizeof(cwd));
+		char cwd_buf[512];
+		const char *cwd = getcwd(cwd_buf, sizeof(cwd_buf));
 		if (cwd == NULL) {
-			die(&st, NULL, "unable to get current path");
+			die(&st, "getcwd", "unable to get current path");
 		}
 		snprintf(buf, sizeof(buf), "%s/%s", cwd, st.server_root);
 		sstrlcpy(st.server_root, buf);
@@ -546,12 +547,12 @@ int main(int argc, char *argv[])
 	 */
 	if (st.opt_exec) {
 		if (st.extra_unveil_paths != NULL) {
-			die(&st, NULL, "-U and executable maps cannot co-exist");
+			die(&st, "flags", "-U and executable maps cannot co-exist");
 		}
 		log_debug("executable gophermaps are enabled, no unveil(2)");
 	} else {
 		if (unveil(st.server_root, "r") == -1)
-			die(&st, NULL, "unveil");
+			die(&st, "unveil", st.server_root);
 
 		/*
 		 * If we want personal gopherspaces, then we have to unveil(2) the user
@@ -562,7 +563,7 @@ int main(int argc, char *argv[])
 		if (st.opt_personal_spaces) {
 			log_debug("unveiling /etc/pwd.db");
 			if (unveil("/etc/pwd.db", "r") == -1)
-				die(&st, NULL, "unveil");
+				die(&st, "unveil", "/etc/pwd.db");
 		}
 
 		/* Any extra unveil paths that the user has specified */
@@ -574,11 +575,11 @@ int main(int argc, char *argv[])
 
 			log_debug("unveiling extra path: %s\n", extra_unveil);
 			if (unveil(extra_unveil, "r") == -1)
-				die(&st, NULL, "unveil");
+				die(&st, "unveil", extra_unveil);
 		}
 
 		if (unveil(NULL, NULL) == -1)
-			die(&st, NULL, "unveil");
+			die(&st, "unveil", "locking unveil");
 	}
 
 	/* pledge(2) support */
@@ -603,7 +604,7 @@ int main(int argc, char *argv[])
 		}
 
 		if (pledge(pledges, NULL) == -1)
-			die(&st, NULL, "pledge");
+			die(&st, "pledge", pledges);
 	}
 #endif
 
@@ -808,7 +809,7 @@ get_selector:
 		}
 
 		/* Requested file not found - die() */
-		die(&st, ERR_NOTFOUND, NULL);
+		die(&st, st.req_selector, ERR_NOTFOUND);
 	}
 
 	/* Fetch request filesize from stat() */
@@ -837,7 +838,7 @@ get_selector:
 	if ((file.st_mode & S_IFMT) != S_IFDIR) c = dirname(buf);
 	else c = buf;
 
-	if (chdir(c) == ERROR) die(&st, ERR_ACCESS, NULL);
+	if (chdir(c) == ERROR) die(&st, ERR_ACCESS, "");
 
 	/* Keep count of hits and data transfer */
 #ifdef HAVE_SHMEM