Fix the problem with template compilation