Implemented Equals() for Template.cs, which fixes some problems.