Add special templates for domains, other fixes