Added tests for template functionality