diff --git a/src/js/foreachMacroJS.tw b/src/js/foreachMacroJS.tw
index ac1472628a930871192bef5be8990256d727eb38..ce497a4907768e3974b8cc3eb748ff8c182c60ef 100644
--- a/src/js/foreachMacroJS.tw
+++ b/src/js/foreachMacroJS.tw
@@ -19,7 +19,7 @@ Macro.add('foreach', {
 			}
 		}
 		if(!variable || !array) {
-			return this.error('invalid syntax, format: <<foreach variable of array-expression>>');
+			return this.error('invalid syntax, format: <<foreach variable of array-expression>>... <</foreach>>');
 		}
 		
 		try {
@@ -56,4 +56,4 @@ Macro.add('foreach', {
 			new Wikifier(this.output, payload);
 		}
 	}
-});
\ No newline at end of file
+});
diff --git a/src/pregmod/SlaveSupport.tw b/src/pregmod/SlaveSupport.tw
index 1252605dab74752e022b75e143c1a97d899abda5..d9f92e6e174925a7f7f379ccc166b17faeb395bf 100644
--- a/src/pregmod/SlaveSupport.tw
+++ b/src/pregmod/SlaveSupport.tw
@@ -41,10 +41,11 @@ Where should the slave be assigned?
 			<<set $SSLevelLaunchBay = 1, $slaves[$i].XP + 1>>
 			<</replace>><</link>>
 		<<if $terrain == "oceanic">>	
-		<</link>><<link "Naval Yard.">>
+		        <<link "Naval Yard.">>
 			<<replace "#result0">>
 			<<set $SSLevelNavalYard = 1, $slaves[$i].XP + 1>>
-			<</replace>><</link>><</if>>
+			<</replace>><</link>>
+                <</if>>
 <span>
 
 /* <<switch $SlaveSupportDecoration>>
@@ -155,4 +156,4 @@ Where should the slave be assigned?
 	<<resetAssignmentFilter>>
 </span>
 
-<br><br>Rename $SlaveSupportName: <<textbox "$SlaveSupportName" $SlaveSupportName "SlaveSupport">> //Use a noun or similar short phrase//
\ No newline at end of file
+<br><br>Rename $SlaveSupportName: <<textbox "$SlaveSupportName" $SlaveSupportName "SlaveSupport">> //Use a noun or similar short phrase//
diff --git a/src/pregmod/SlaveSupportReport.tw b/src/pregmod/SlaveSupportReport.tw
index d4b663e351e79c021d301059e610ad8fc18d38dd..aef98ad5064829d0e1bddd0adbdfb82229b13527 100644
--- a/src/pregmod/SlaveSupportReport.tw
+++ b/src/pregmod/SlaveSupportReport.tw
@@ -15,31 +15,34 @@
 
 <<if $SSLevelBarracks && $slaves[$i].XP >= 15>>
 	<<set $SSLBSCA += 1, $slaves[_FLs].devotion += 5, $slaves[_FLs].trust += 5,$slaves[_FLs].intelligence = 3,$slaves[_FLs].intelligenceImplant = 1, $slaves[_FLs].combatSkill = 1>>
-	<<elseif $SSLevelBarracks && $slaves[$i].XP >= 10>>
+<<elseif $SSLevelBarracks && $slaves[$i].XP >= 10>>
 	<<set $SSLBCA += 1, $slaves[_FLs].devotion += 4, $slaves[_FLs].trust += 4,$slaves[_FLs].intelligence = 2,$slaves[_FLs].intelligenceImplant = 1, $slaves[_FLs].combatSkill = 1>>
-	<<elseif if $SSLevelBarracks && $slaves[$i].XP >= 5>>
+<<elseif $SSLevelBarracks && $slaves[$i].XP >= 5>>
 	<<set $SSLBHC += 1, $slaves[_FLs].devotion += 3, $slaves[_FLs].trust += 3,$slaves[_FLs].intelligence = 1,$slaves[_FLs].intelligenceImplant = 0, $slaves[_FLs].combatSkill = 0>>
-	<<elseif if $SSLevelBarracks && $slaves[$i].XP >= 1>>
+<<elseif $SSLevelBarracks && $slaves[$i].XP >= 1>>
 	<<set $SSLBC += 1, $slaves[_FLs].devotion += 2, $slaves[_FLs].trust += 2,$slaves[_FLs].intelligence = 0,$slaves[_FLs].intelligenceImplant = 0, $slaves[_FLs].combatSkill = 0>>
+<</if>>
 	
 <<if $SSLevelArmoury && $slaves[$i].XP >= 15>>
 	<<set $SSLASAST += 1, $slaves[_FLs].devotion += 5, $slaves[_FLs].trust += 5,$slaves[_FLs].intelligence = 3,$slaves[_FLs].intelligenceImplant = 1, $slaves[_FLs].combatSkill = 1>>
-	<<elseif $SSLevelArmoury && $slaves[$i].XP >= 10>>
+<<elseif $SSLevelArmoury && $slaves[$i].XP >= 10>>
 	<<set $SSLAAST += 1, $slaves[_FLs].devotion += 4, $slaves[_FLs].trust += 4,$slaves[_FLs].intelligence = 2,$slaves[_FLs].intelligenceImplant = 1, $slaves[_FLs].combatSkill = 1>>
-	<<elseif if $SSLevelArmoury && $slaves[$i].XP >= 5>>
+<<elseif $SSLevelArmoury && $slaves[$i].XP >= 5>>
 	<<set $SSLASM += 1, $slaves[_FLs].devotion += 3, $slaves[_FLs].trust += 3,$slaves[_FLs].intelligence = 1,$slaves[_FLs].intelligenceImplant = 0, $slaves[_FLs].combatSkill = 0>>
-	<<elseif if $SSLevelArmoury && $slaves[$i].XP >= 1>>
+<<elseif $SSLevelArmoury && $slaves[$i].XP >= 1>>
 	<<set $SSLAM += 1, $slaves[_FLs].devotion += 2, $slaves[_FLs].trust += 2,$slaves[_FLs].intelligence = 0,$slaves[_FLs].intelligenceImplant = 0, $slaves[_FLs].combatSkill = 0>>
+<</if>>
 	
 <<if $SSLevelStimulantLab && $slaves[$i].XP >= 15>>
 	<<set $SSLSLPH += 1, $slaves[_FLs].devotion += 5, $slaves[_FLs].trust += 5,$slaves[_FLs].intelligence = 3,$slaves[_FLs].intelligenceImplant = 1, $slaves[_FLs].combatSkill = 1>>
-	<<elseif $SSLevelStimulantLab && $slaves[$i].XP >= 10>>
+<<elseif $SSLevelStimulantLab && $slaves[$i].XP >= 10>>
 	<<set $SSLSLSC += 1, $slaves[_FLs].devotion += 4, $slaves[_FLs].trust += 4,$slaves[_FLs].intelligence = 2,$slaves[_FLs].intelligenceImplant = 1, $slaves[_FLs].combatSkill = 1>>
-	<<elseif if $SSLevelStimulantLab && $slaves[$i].XP >= 5>>
+<<elseif $SSLevelStimulantLab && $slaves[$i].XP >= 5>>
 	<<set $SSLSLAC += 1, $slaves[_FLs].devotion += 3, $slaves[_FLs].trust += 3,$slaves[_FLs].intelligence = 1,$slaves[_FLs].intelligenceImplant = 0, $slaves[_FLs].combatSkill = 0>>
-	<<elseif if $SSLevelStimulantLab && $slaves[$i].XP >= 1>>
+<<elseif $SSLevelStimulantLab && $slaves[$i].XP >= 1>>
 	<<set $SSLC += 1, $slaves[_FLs].devotion += 2, $slaves[_FLs].trust += 2,$slaves[_FLs].intelligence = 0,$slaves[_FLs].intelligenceImplant = 0, $slaves[_FLs].combatSkill = 0>>
+<</if>>
 	
 <<if (_DL > 0)>>
 	&nbsp;&nbsp;&nbsp;&nbsp;<<if (_DL == 1)>>''One slave has been assigned to $SlaveSupportName.''<<else>>''_DL slaves have been assigned to $SlaveSupportName.''<</if>>
-<</if>>
\ No newline at end of file
+<</if>>
diff --git a/src/societies/aztec/slaveSacrifice.tw b/src/societies/aztec/slaveSacrifice.tw
index 5d87cd6b4b0abd0211d18206d336c5e8c8a6ed22..56938c1a3b1bf6aa8980e29de277bfbec4acbbaf 100644
--- a/src/societies/aztec/slaveSacrifice.tw
+++ b/src/societies/aztec/slaveSacrifice.tw
@@ -311,19 +311,19 @@
 			<<set $activeSlave.devotion -= 5, $activeSlave.trust -= 5>>
 				The constant abuse to her mouth for her feedings and the pain you subject her to makes her @@.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 			<<set $activeSlave.fetishStrength -= 5>>
-		<<if ($activeSlave.sexualFlaw == "hates anal")>>
+		<<elseif ($activeSlave.sexualFlaw == "hates anal")>>
 			<<set $activeSlave.devotion -= 5, $activeSlave.trust -= 5>>
 				Her constant need of release without the chance to stimulate her ass and the pain you subject her to made her @@.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 			<<set $activeSlave.fetishStrength -= 2>>
-		<<if ($activeSlave.sexualFlaw == "shamefast")>>
+		<<elseif ($activeSlave.sexualFlaw == "shamefast")>>
 			<<set $activeSlave.devotion -= 5, $activeSlave.trust -= 5>>
 				The constant exposure of her naked body through the bars to anyone willing to see her and the pain you subjected her to made her @@.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 			<<set $activeSlave.fetishStrength -= 4>>
-		<<if ($activeSlave.sexualFlaw == " self hating ")>>
+		<<elseif ($activeSlave.sexualFlaw == "self hating")>>
 			<<set $activeSlave.devotion -= 5, $activeSlave.trust -= 5>>
 				The constant depravation of food, sleep and sexual release made her hate herself more. As a result she @.mediumorchid;trusts you less@@ and @@.hotpink;hates you more@@.
 			<<set $activeSlave.fetishStrength += 7>>
-		<<if ($activeSlave.sexualFlaw == "repressed")>>
+		<<elseif ($activeSlave.sexualFlaw == "repressed")>>
 			<<set $activeSlave.fetishStrength -= 2>>
 				The constant shame she was subjected in such a public way made her @.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 		<<else>>
@@ -343,18 +343,18 @@
 			<<set $activeSlave.devotion -= 7, $activeSlave.trust -= 7>>
 				The constant abuse of her mouth for feedings and the pain you subjected her to made her @@.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 			<<set $activeSlave.fetishStrength -= 6>>
-	<<if ($activeSlave.sexualFlaw == "shamefast")>>
+	<<elseif ($activeSlave.sexualFlaw == "shamefast")>>
 			<<set $activeSlave.devotion -= 7, $activeSlave.trust -= 7>>
 				The constant exposure of her naked body through the bars to anyone willing to see her and the pain you subjected her to makes her @@.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 			<<set $activeSlave.fetishStrength -= 5>>
-	<<if ($activeSlave.sexualFlaw == "repressed")>>
+	<<elseif ($activeSlave.sexualFlaw == "repressed")>>
 			<<set $activeSlave.devotion -= 7, $activeSlave.trust -= 7>>
 				The constant shame she was subjected in such a public way makes her @.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
-	<<if ($activeSlave.sexualFlaw == " attention whore ")>>
+	<<elseif ($activeSlave.sexualFlaw == "attention whore")>>
 			<<set $activeSlave.devotion -= 7, $activeSlave.trust -= 7>>
 				She @.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@ for spoiling her chance for attention and depriving her of her audience.
 		<<set $activeSlave.fetishStrength += 2>>
-	<<if ($activeSlave.sexualFlaw == " self hating ")>>
+	<<elseif ($activeSlave.sexualFlaw == "self hating")>>
 		<<set $activeSlave.devotion -= 7, $activeSlave.trust -= 7>>
 			The constant depravation of food, sleep and sexual release made her hate herself more. As a result she @.mediumorchid;trust you less@@ and @@.hotpink;hate you more@@.
 		<<set $activeSlave.fetishStrength += 5>>
diff --git a/src/uncategorized/RESS.tw b/src/uncategorized/RESS.tw
index 734c8567086ad1e154ff5bd5d8bc002830dea360..c572f66f9b1e20ded74c092759856d4b7c605322 100644
--- a/src/uncategorized/RESS.tw
+++ b/src/uncategorized/RESS.tw
@@ -4085,8 +4085,6 @@ She does her very best to get through the inspection without disgrace, hugging h
 <<case "breeding bull">>
 
 <<link "Push her off of you">>
-	<<EventNameDelink $activeSlave>>
-	<<replace "#result">>
 	<<EventNameDelink $activeSlave>>
 	<<replace "#result">>
 		<<if $arcologies[0].FSPhysicalIdealist != "unset">>
diff --git a/src/uncategorized/securityForceEOWReport.tw b/src/uncategorized/securityForceEOWReport.tw
index 620d1067df56e026d00b66dd7e4a62cd6bdbcff2..6432726c35d8309f4e92c13098248b3a353e4db2 100644
--- a/src/uncategorized/securityForceEOWReport.tw
+++ b/src/uncategorized/securityForceEOWReport.tw
@@ -318,8 +318,8 @@ securityForceX */
 	<<elseif $securityForceFocus == "raiding">>locating and striking targets of opportunity, capturing both material loot and new slaves. Smaller parties secured the most important of the arcology's trade routes and processed new recruits. <</if>> These activities have, overall, @@.green;improved@@ your arcology's prosperity. <<if $securityForceProfitable == 1>>The goods procured by the $securityForceName this week, after accounting for the spoils retained by individual soldiers, were @@.green;more than sufficient@@ to cover expenses. Excess material and human assets totalling @@.yellowgreen;¤$securityForceIncome@@ (after liquidation) were transferred to your accounts. <<elseif $securityForceProfitable == 0>>The goods procured by the security force were, after accounting for the spoils retained by individual soldiers, @@.red;barely enough@@ to cover expenses. More growth will be needed to ensure profitability.<</if>> $securityForceName managed to recruit $securityForceRecruit new soldiers this week, and your reputation has @@.green;improved@@ through the improvement of trade security.
 	/* SlaveSupportSummary */
 	/* <<if $SSLevelBarracks > 0>>In the Barracks there are $SSLBSCA senior Colonel assistants, $SSLBCA Colonel assistants, $SSLBHC head cleaners and $SSLBC cleaners.<</if>>
-	<<if SSLevelArmory > 0>>The Armory has $SSLASAST senior assistant supply technicians, $SSLAAST assistant supply technicians $SSLASM senor matainers and $SSLAM matainers.<</if>>
-	if $SSLevelStimulantLab > 0 >>The stimulant Lab has $SSLSLPH project heads, $SSLSLSC senior chemists, $SSLSLAC assistant chemists and $SSLC cleaners.<</if>> */
+	<<if $SSLevelArmoury > 0>>The Armory has $SSLASAST senior assistant supply technicians, $SSLAAST assistant supply technicians $SSLASM senor matainers and $SSLAM matainers.<</if>>
+	<<if $SSLevelStimulantLab > 0 >>The stimulant Lab has $SSLSLPH project heads, $SSLSLSC senior chemists, $SSLSLAC assistant chemists and $SSLC cleaners.<</if>> */
 <</nobr>>	
 	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Your instructions to The Colonel://
 		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deployment focus: <span id="focus"><<if $securityForceFocus == "recruit">>''Recruiting and Training''<<elseif $securityForceFocus == "secure">>''Securing Trade Routes''<<else>>''Raiding and Slaving''<</if>></span>.&nbsp;&nbsp; <<link "Recruit and Train">><<set $securityForceFocus = "recruit">><<replace "#focus">>''Recruiting and Training''<</replace>><</link>> | <<link "Secure Trade Routes">><<set $securityForceFocus = "secure">><<replace "#focus">>''Securing Trade Routes''<</replace>><</link>> | <<link "Raiding and Slaving">><<set $securityForceFocus = "raiding">><<replace "#focus">>''Raiding and Slaving''<</replace>><</link>>
@@ -648,4 +648,4 @@ securityForceX */
 <</if>>
 <</if>>
 <</if>>
-<</nobr>>
\ No newline at end of file
+<</nobr>>