Added fixes for template creation, when generated by Page Schemas

Change-Id: Ie1152e708d9430f13442391d3f9613851fb3ce2c