diff --git a/src/js/DefaultRules.tw b/src/js/DefaultRules.tw
index 0a25efec15fbec8f84c31e55552960eac91659f9..ad65d5fe555bfe92c8fd1e77eda231b720511bc8 100644
--- a/src/js/DefaultRules.tw
+++ b/src/js/DefaultRules.tw
@@ -8,9 +8,9 @@ window.DefaultRules = (function() {
 
 	function DefaultRules(slave) {
 		console.log("default ruling for", slave);
-		console.log("the passage is", State.passage);
 		V = State.variables
 		let rule = MergeRules(slave)
+		console.log("done merging", rule)
 
 		if (Object.keys(rule).length === 0) return r // no rules apply
 
@@ -57,18 +57,11 @@ window.DefaultRules = (function() {
 
 	function MergeRules(slave) {
 		// merge all rules applying on a slave into one big rule
-		let combinedRule = {}
-		V.defaultRules.forEach(rule => {
-			rule = Object.assign({}, rule.set)
-			
-			// skip inapplicable rules 
-			if (!ruleApplied(slave, rule)) return
-			ProcessAssignments(rule)
-
-			// merge the current rule (possibly modified by the code above) into the combined rule 
-			combinedRule = mergeRules([combinedRule, rule])
-		})
-		return combinedRule
+		const rules = (V.defaultRules
+			.filter(rule => ruleAppliesP(rule.condition, slave))
+			.map(rule => ProcessAssignments(slave, Object.assign({}, rule.set)))
+		);
+		return mergeRules(rules);
 	}
 
 	function ProcessAssignments(slave, rule) {
@@ -239,6 +232,7 @@ window.DefaultRules = (function() {
 				r += `<span class="red">raWidgets missing case for assignment 'V.{rule.setAssignment}'</span>.`
 				break
 		}
+		return rule
 	}
 
 	function AssignJobToSlave(slave, rule) {
diff --git a/src/js/rulesAssistant.tw b/src/js/rulesAssistant.tw
index 986dda62393937f9ea9bb244da21e2d8b00de449..b127b99335f0cb119d441bae9ba1dd263212a883 100644
--- a/src/js/rulesAssistant.tw
+++ b/src/js/rulesAssistant.tw
@@ -42,6 +42,7 @@ window.mergeRules = function mergeRules(rules) {
 			combinedRule[key] = rule[key];
 		});
 	});
+	return combinedRule;
 };
 
 // return if a rule is applied on a slave
@@ -189,8 +190,8 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) {
 	// assignment / facility / special slaves / specific slaves check
 	flag = flag &&
 		!(cond.excludeSpecialSlaves && isLeaderP(slave)) &&
-		(cond.assignment.length > 0 && cond.assignment.includes(slave.assignment)) &&
-		(cond.selectedSlaves.length > 0 && cond.selectedSlaves.includes(slave.ID)) &&
+		(cond.assignment.length === 0 || cond.assignment.includes(slave.assignment)) &&
+		(cond.selectedSlaves.length === 0 || cond.selectedSlaves.includes(slave.ID)) &&
 		!(cond.excludedSlaves.includes(slave.ID));
 	return flag;
 };
diff --git a/src/js/rulesAssistantOptions.tw b/src/js/rulesAssistantOptions.tw
index 2e74e2d10b426e0357a59a33903abd665bb64ef0..800a5b35ddf09b7dfc7ce896dae08f1baf91c10f 100644
--- a/src/js/rulesAssistantOptions.tw
+++ b/src/js/rulesAssistantOptions.tw
@@ -573,12 +573,12 @@ window.rulesAssistantOptions = (function() {
 			}
 			switch(value) {
 				case true:
-					current_rule.condition.function = false;
+					current_rule.condition.function = true;
 					current_rule.condition.data = {};
 					this.hide_custom_editor();
 					break;
 				case false:
-					current_rule.condition.function = true;
+					current_rule.condition.function = false;
 					current_rule.condition.data = {};
 					this.hide_custom_editor();
 					break;