Changed the behavior of the template handling.