Fixed the use of templates