templates tests and fixes