Added support for nested nests within templates.