diff --git a/src/SecExp/securityReport.tw b/src/SecExp/securityReport.tw
index a872ab77b268885318b1e0df46b4d42ffa786b0a..b3b38ffbf1ad036581c5d56f389b87e44966718e 100644
--- a/src/SecExp/securityReport.tw
+++ b/src/SecExp/securityReport.tw
@@ -356,6 +356,7 @@
 		<<else>>
 			There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower.
 		<</if>>
+		<br>
 	<</if>>
 
 	/* mercs */
@@ -396,129 +397,132 @@
 			<<set $mercTotalManpower -= $mercFreeManpower - 2000>>
 			<<set $mercFreeManpower = 2000>>
 		<</if>>
-	<</if>>
-	<br>
-	/* loyalty and training */
-	<<set _sL = $slaveUnits.length>>
-	<<for _i = 0; _i < _sL; _i++>>
-		<<set _loyaltyChange = 0>>
 		<br>
-		<br> $slaveUnits[_i].platoonName:
-		<<if $secBarracksUpgrades.loyaltyMod >= 1>>
-			<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
-			is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
-		<</if>>
-		<<if $slaveUnits[_i].commissars >= 1>>
-			The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
-			<<set _loyaltyChange += 2 * $slaveUnits[_i].commissars>>
-		<</if>>
-		<<if $soldierWages == 2>>
-			The slaves greatly appreciate the generous wage given to them for their service as soldiers. Occasions to earn money for a slave are scarce after all.
-			<<set _loyaltyChange += random(5,10)>>
-		<<elseif $soldierWages == 1>>
-			The slaves appreciate the wage given to them for their service as soldiers, despite it being just adequate. Occasions to earn money for a slave are scarce after all.
-			<<set _loyaltyChange += random(-5,5)>>
-		<<else>>
-			The slaves do not appreciate the low wage given to them for their service as soldiers, but occasions to earn money for a slave are scarce, so they're not too affected by it.
-			<<set _loyaltyChange -= random(5,10)>>
-		<</if>>
-		<<if $slaveSoldierPrivilege == 1>>
-			Allowing them to hold material possessions earns you their devotion and loyalty.
-			<<set _loyaltyChange += random(1,2)>>
-		<</if>>
-		<<if _loyaltyChange > 0>>
-			The loyalty of this unit @@.green;increased@@ this week.
-		<<elseif _loyaltyChange == 0>>
-			The loyalty of this unit @@.yellow;did not change@@ this week.
-		<<else>>
-			The loyalty of this unit @@.red;decreased@@ this week.
-		<</if>>
-		<<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + _loyaltyChange,0,100)>>
-		<<if $slaveUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
-			<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
-			<<set $slaveUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
-		<</if>>
-	<</for>>
-	<<set _mL = $militiaUnits.length>>
-	<<for _i = 0; _i < _mL; _i++>>
-		<br>
-		<br>$militiaUnits[_i].platoonName:
-		<<set _loyaltyChange = 0>>
-		<<if $secBarracksUpgrades.loyaltyMod >= 1>>
-			<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
-			is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
-		<</if>>
-		<<if $militiaUnits[_i].commissars >= 1>>
-			The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
-			<<set _loyaltyChange += 2 * $militiaUnits[_i].commissars>>
-		<</if>>
-		<<if $soldierWages == 2>>
-			The soldiers greatly appreciate the generous wage given to them for their service. They are proud to defend their homes while making a small fortune out of it.
-			<<set _loyaltyChange += random(5,10)>>
-		<<elseif $soldierWages == 1>>
-			The soldiers appreciate the wage given to them for their service, despite it being just adequate. They are proud to defend their homes, though at the cost of possible financial gains.
-			<<set _loyaltyChange += random(-5,5)>>
-		<<else>>
-			The soldiers do not appreciate the low wage given to them for their service. Their sense of duty keeps them proud of their role as defenders of the arcology, but many do feel its financial weight.
-			<<set _loyaltyChange -= random(5,10)>>
-		<</if>>
-		<<if $militiaSoldierPrivilege == 1>>
-			Allowing them to avoid rent payment for their military service earns you their happiness and loyalty.
-			<<set _loyaltyChange += random(1,2)>>
-		<</if>>
-		<<if _loyaltyChange > 0>>
-			The loyalty of this unit @@.green;increased@@ this week.
-		<<elseif _loyaltyChange == 0>>
-			The loyalty of this unit @@.yellow;did not change@@ this week.
-		<<else>>
-			The loyalty of this unit @@.red;decreased@@ this week.
-		<</if>>
-		<<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + _loyaltyChange,0,100)>>
-		<<if $militiaUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
-			<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
-			<<set $militiaUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
-		<</if>>
-	<</for>>
-	<<set _meL = $mercUnits.length>>
-	<<for _i = 0; _i < _meL; _i++>>
-		<br>
-		<br>$mercUnits[_i].platoonName:
-		<<set _loyaltyChange = 0>>
-		<<if $secBarracksUpgrades.loyaltyMod >= 1>>
-			<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
-			is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
-		<</if>>
-		<<if $mercUnits[_i].commissars >= 1>>
-			The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
-			<<set _loyaltyChange += 2 * $mercUnits[_i].commissars>>
-		<</if>>
-		<<if $soldierWages == 2>>
-			The mercenaries greatly appreciate the generous wage given to them for their service. After all coin is the fastest way to reach their hearts.
-			<<set _loyaltyChange += random(5,10)>>
-		<<elseif $soldierWages == 1>>
-			The mercenaries do not appreciate the barely adequate wage given to them for their service. Still their professionalism keeps them determined to finish their contract.
-			<<set _loyaltyChange += random(-5,5)>>
-		<<else>>
-			The mercenaries do not appreciate the low wage given to them for their service.Their skill would be better served by a better contract and this world does not lack demand for guns for hire.
-			<<set _loyaltyChange -= random(5,10)>>
-		<</if>>
-		<<if $mercSoldierPrivilege == 1>>
-			Allowing them to keep part of the loot gained from your enemies earns you their trust and loyalty.
-			<<set _loyaltyChange += random(1,2)>>
-		<</if>>
-		<<if _loyaltyChange > 0>>
-			The loyalty of this unit @@.green;increased@@ this week.
-		<<elseif _loyaltyChange == 0>>
-			The loyalty of this unit @@.yellow;did not change@@ this week.
-		<<else>>
-			The loyalty of this unit @@.red;decreased@@ this week.
-		<</if>>
-		<<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + _loyaltyChange,0,100)>>
-		<<if $mercUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
-			<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
-			<<set $mercUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
-		<</if>>
-	<</for>>
+	<</if>>
+	
+	<<if $activeUnits > 0>>
+		/* loyalty and training */
+		<<set _sL = $slaveUnits.length>>
+		<<for _i = 0; _i < _sL; _i++>>
+			<<set _loyaltyChange = 0>>
+			<br>
+			<br> $slaveUnits[_i].platoonName:
+			<<if $secBarracksUpgrades.loyaltyMod >= 1>>
+				<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
+				is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
+			<</if>>
+			<<if $slaveUnits[_i].commissars >= 1>>
+				The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
+				<<set _loyaltyChange += 2 * $slaveUnits[_i].commissars>>
+			<</if>>
+			<<if $soldierWages == 2>>
+				The slaves greatly appreciate the generous wage given to them for their service as soldiers. Occasions to earn money for a slave are scarce after all.
+				<<set _loyaltyChange += random(5,10)>>
+			<<elseif $soldierWages == 1>>
+				The slaves appreciate the wage given to them for their service as soldiers, despite it being just adequate. Occasions to earn money for a slave are scarce after all.
+				<<set _loyaltyChange += random(-5,5)>>
+			<<else>>
+				The slaves do not appreciate the low wage given to them for their service as soldiers, but occasions to earn money for a slave are scarce, so they're not too affected by it.
+				<<set _loyaltyChange -= random(5,10)>>
+			<</if>>
+			<<if $slaveSoldierPrivilege == 1>>
+				Allowing them to hold material possessions earns you their devotion and loyalty.
+				<<set _loyaltyChange += random(1,2)>>
+			<</if>>
+			<<if _loyaltyChange > 0>>
+				The loyalty of this unit @@.green;increased@@ this week.
+			<<elseif _loyaltyChange == 0>>
+				The loyalty of this unit @@.yellow;did not change@@ this week.
+			<<else>>
+				The loyalty of this unit @@.red;decreased@@ this week.
+			<</if>>
+			<<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + _loyaltyChange,0,100)>>
+			<<if $slaveUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
+				<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+				<<set $slaveUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
+			<</if>>
+		<</for>>
+		<<set _mL = $militiaUnits.length>>
+		<<for _i = 0; _i < _mL; _i++>>
+			<br>
+			<br>$militiaUnits[_i].platoonName:
+			<<set _loyaltyChange = 0>>
+			<<if $secBarracksUpgrades.loyaltyMod >= 1>>
+				<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
+				is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
+			<</if>>
+			<<if $militiaUnits[_i].commissars >= 1>>
+				The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
+				<<set _loyaltyChange += 2 * $militiaUnits[_i].commissars>>
+			<</if>>
+			<<if $soldierWages == 2>>
+				The soldiers greatly appreciate the generous wage given to them for their service. They are proud to defend their homes while making a small fortune out of it.
+				<<set _loyaltyChange += random(5,10)>>
+			<<elseif $soldierWages == 1>>
+				The soldiers appreciate the wage given to them for their service, despite it being just adequate. They are proud to defend their homes, though at the cost of possible financial gains.
+				<<set _loyaltyChange += random(-5,5)>>
+			<<else>>
+				The soldiers do not appreciate the low wage given to them for their service. Their sense of duty keeps them proud of their role as defenders of the arcology, but many do feel its financial weight.
+				<<set _loyaltyChange -= random(5,10)>>
+			<</if>>
+			<<if $militiaSoldierPrivilege == 1>>
+				Allowing them to avoid rent payment for their military service earns you their happiness and loyalty.
+				<<set _loyaltyChange += random(1,2)>>
+			<</if>>
+			<<if _loyaltyChange > 0>>
+				The loyalty of this unit @@.green;increased@@ this week.
+			<<elseif _loyaltyChange == 0>>
+				The loyalty of this unit @@.yellow;did not change@@ this week.
+			<<else>>
+				The loyalty of this unit @@.red;decreased@@ this week.
+			<</if>>
+			<<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + _loyaltyChange,0,100)>>
+			<<if $militiaUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
+				<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+				<<set $militiaUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
+			<</if>>
+		<</for>>
+		<<set _meL = $mercUnits.length>>
+		<<for _i = 0; _i < _meL; _i++>>
+			<br>
+			<br>$mercUnits[_i].platoonName:
+			<<set _loyaltyChange = 0>>
+			<<if $secBarracksUpgrades.loyaltyMod >= 1>>
+				<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
+				is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
+			<</if>>
+			<<if $mercUnits[_i].commissars >= 1>>
+				The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
+				<<set _loyaltyChange += 2 * $mercUnits[_i].commissars>>
+			<</if>>
+			<<if $soldierWages == 2>>
+				The mercenaries greatly appreciate the generous wage given to them for their service. After all coin is the fastest way to reach their hearts.
+				<<set _loyaltyChange += random(5,10)>>
+			<<elseif $soldierWages == 1>>
+				The mercenaries do not appreciate the barely adequate wage given to them for their service. Still their professionalism keeps them determined to finish their contract.
+				<<set _loyaltyChange += random(-5,5)>>
+			<<else>>
+				The mercenaries do not appreciate the low wage given to them for their service.Their skill would be better served by a better contract and this world does not lack demand for guns for hire.
+				<<set _loyaltyChange -= random(5,10)>>
+			<</if>>
+			<<if $mercSoldierPrivilege == 1>>
+				Allowing them to keep part of the loot gained from your enemies earns you their trust and loyalty.
+				<<set _loyaltyChange += random(1,2)>>
+			<</if>>
+			<<if _loyaltyChange > 0>>
+				The loyalty of this unit @@.green;increased@@ this week.
+			<<elseif _loyaltyChange == 0>>
+				The loyalty of this unit @@.yellow;did not change@@ this week.
+			<<else>>
+				The loyalty of this unit @@.red;decreased@@ this week.
+			<</if>>
+			<<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + _loyaltyChange,0,100)>>
+			<<if $mercUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
+				<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+				<<set $mercUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
+			<</if>>
+		<</for>>
+	<</if>>
 <</if>>