diff --git a/package-lock.json b/package-lock.json
index 9ccda10e755fe948c68a70ce7e7d9103f5ad4743..46e7c65662ff90a3a8fc3990ecf4f141fda27cf8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -375,9 +375,9 @@
       }
     },
     "@types/chai": {
-      "version": "3.5.2",
-      "resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.5.2.tgz",
-      "integrity": "sha1-wRzSgX06QBt7oPWkIPNcVhObHB4=",
+      "version": "4.2.11",
+      "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.11.tgz",
+      "integrity": "sha512-t7uW6eFafjO+qJ3BIV2gGUyZs27egcNRkUdalkud+Qa3+kg//f129iuOFivHDXQ+vnU3fDXuwgv0cqMCbcE8sw==",
       "dev": true
     },
     "@types/color-name": {
@@ -426,9 +426,9 @@
       "integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A=="
     },
     "@types/js-yaml": {
-      "version": "3.12.1",
-      "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.12.1.tgz",
-      "integrity": "sha512-SGGAhXLHDx+PK4YLNcNGa6goPf9XRWQNAUUbffkwVGGXIxmDKWyGGL4inzq2sPmExu431Ekb9aEMn9BkPqEYFA==",
+      "version": "3.12.5",
+      "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.12.5.tgz",
+      "integrity": "sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww==",
       "dev": true
     },
     "@types/keyv": {
@@ -440,14 +440,14 @@
       }
     },
     "@types/mime": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz",
-      "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw=="
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.2.tgz",
+      "integrity": "sha512-4kPlzbljFcsttWEq6aBW0OZe6BDajAmyvr2xknBG92tejQnvdGtT9+kXSZ580DqpxY9qG2xeQVF9Dq0ymUTo5Q=="
     },
     "@types/mocha": {
-      "version": "5.2.7",
-      "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
-      "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==",
+      "version": "7.0.2",
+      "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz",
+      "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==",
       "dev": true
     },
     "@types/node": {
diff --git a/tools/addbot.ts b/tools/addbot.ts
index 335e1f19d51ee103099887b9708fe74151695308..d505fddd9045036e4822aa37bf62889509803ec8 100644
--- a/tools/addbot.ts
+++ b/tools/addbot.ts
@@ -23,6 +23,7 @@ import * as fs from "fs";
 import * as args from "command-line-args";
 import * as usage from "command-line-usage";
 import { Util } from "../src/util";
+import { DiscordBridgeConfig } from "../src/config";
 
 const optionDefinitions = [
   {
@@ -59,9 +60,8 @@ if (options.help) {
 }
 
 const yamlConfig = yaml.safeLoad(fs.readFileSync(options.config, "utf8"));
-if (yamlConfig === null) {
-  console.error("You have an error in your discord config.");
+if (yamlConfig === null || typeof yamlConfig !== "object") {
+  throw Error("You have an error in your discord config.");
 }
-// We assume the config is well formed in this script
-const url = Util.GetBotLink(yamlConfig as any);
+const url = Util.GetBotLink(yamlConfig as DiscordBridgeConfig);
 console.log(`Go to ${url} to invite the bot into a guild.`);
diff --git a/tools/toolshelper.ts b/tools/toolshelper.ts
index a0d571131664b02df6e68966f770a41d85b9486c..1bd3c49b317d94203cc5b45d677d9acb99bc40b8 100644
--- a/tools/toolshelper.ts
+++ b/tools/toolshelper.ts
@@ -1,5 +1,5 @@
 import { DiscordBridgeConfig } from "../src/config";
-import { Appservice } from "matrix-bot-sdk";
+import { Appservice, IAppserviceRegistration } from "matrix-bot-sdk";
 import { DiscordStore } from "../src/store";
 import * as yaml from "js-yaml";
 import * as fs from "fs";
@@ -15,7 +15,7 @@ export class ToolsHelper {
         const config: DiscordBridgeConfig = Object.assign(
             new DiscordBridgeConfig(), yaml.safeLoad(fs.readFileSync(configFile, "utf8")));
         config.applyEnvironmentOverrides(process.env);
-        if (registration === null) {
+        if (registration === null || typeof registration !== "object") {
             throw Error("Failed to parse registration file");
         }
 
@@ -25,7 +25,7 @@ export class ToolsHelper {
             homeserverUrl: config.bridge.homeserverUrl,
             port: 0,
             // We assume the registration is well formed
-            registration: registration as any,
+            registration: registration as IAppserviceRegistration,
         });
 
         const store = needsStore ? new DiscordStore(config.database ? config.database.filename : "discord.db") : null;