-bugfix and enhancement on subtemplate {include} and template {function}