Fix dynamic loading of templates.
Add example.