Fix some broken elements like missing unit names

And fix factory randomization.