Fixed error when footertemplate is not defined
several intermediate changes