Fix a bunch of bugs in the armory and ATech.