Fix fence post error when generating template from a publisher with no children