#660 fixed bug from incorrect method for creating a new template instance using type object