diff --git a/exec/binkit.js b/exec/binkit.js
index e65519bdca4ca5570a41e8f27309e8ece3c4a40c..08773f36db548c8e2343b1372abc4e72e2bfa0b7 100644
--- a/exec/binkit.js
+++ b/exec/binkit.js
@@ -161,7 +161,11 @@ function add_outbound_files(addrs, bp)
 				var fnchars = '0123456789abcdefghijklmnopqrstuvwxyz';
 				var fname;
 
-				switch(file_getext(file).toLowerCase()) {
+				var ext = file_getext(file);
+				if (ext !== undefined)
+					ext = ext.toLowerCase();
+				
+				switch(ext) {
 					case '.clo':
 					case '.dlo':
 					case '.flo':
@@ -684,6 +688,10 @@ function run_one_outbound_dir(dir, scfg, ran)
 			if (ran[addr] !== undefined)
 				continue;
 			ext = file_getext(flow_files[i]);
+			if (ext === undefined) {
+				log(LOG_WARNING, "Unknown flow file flavour '"+flow_files[i]+"'.");
+				continue;
+			}
 
 			// Ensure this is the "right" outbound (file case, etc)
 			if (flow_files[i] !== outbound_root(addr, scfg)+addr.flo_outbound(myaddr.zone)+ext.substr(1)) {