Finishing tests for Templates; some fixes.