Fixed all the issues related to template errors