Fixed a bug when templates are used w/o hooks