Updated a few templates and added unit tests.