diff --git a/classes/urlhelper.php b/classes/urlhelper.php
index 91e1d482260683cc47e2c59bb17af562135119f0..9bb4da962465bb5a8a5563390cef547f1d1a1fe1 100644
--- a/classes/urlhelper.php
+++ b/classes/urlhelper.php
@@ -89,8 +89,8 @@ class UrlHelper {
 		} else {
 			$base_parts = parse_url($base_url);
 
-			$rel_parts['host'] = $base_parts['host'];
-			$rel_parts['scheme'] = $base_parts['scheme'];
+			$rel_parts['host'] = $base_parts['host'] ?? "";
+			$rel_parts['scheme'] = $base_parts['scheme'] ?? "";
 
 			if (isset($rel_parts['path'])) {
 
diff --git a/include/errorhandler.php b/include/errorhandler.php
index 09d6bd7bcba3eceb08dc2c53c7eaf1e08a03a3f3..ff2af8cd0db58812286f5c60ace6b662e7e312f4 100644
--- a/include/errorhandler.php
+++ b/include/errorhandler.php
@@ -19,7 +19,7 @@ function format_backtrace($trace): string {
 							array_push($fmt_args, "[" . truncate_string(json_encode($a), 256, "...")) . "]";
 						} else if (is_resource($a)) {
 							array_push($fmt_args, truncate_string(get_resource_type($a), 256, "..."));
-						} else {
+						} else if ($a) {
 							array_push($fmt_args, truncate_string($a, 256, "..."));
 						}
 					}
diff --git a/include/functions.php b/include/functions.php
index af4819f00a356e39ae2a982f5d63b9359bd3abeb..14de32e95ba42546ccab1c8e3499ad49dde9b3e1 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -341,7 +341,12 @@
 		}
 	}
 
-	function sql_bool_to_bool(string $s): bool {
+	/** Convert values accepted by tt-rss as true/false to PHP booleans
+	 * @see https://tt-rss.org/wiki/ApiReference#boolean-values
+	 * @param null|string $s null values are considered false
+	 * @return bool
+	 */
+	function sql_bool_to_bool(?string $s): bool {
 		return $s && ($s !== "f" && $s !== "false"); //no-op for PDO, backwards compat for legacy layer
 	}