Corrected issues with the barracks trigger, updated object validity checks.