More unit tests for Template and Writer