Fix page/template re-definition issue