Template overwrite

Fixed some errors, and tested it.

References #3