Solve the compile error in templates.