Fix compile error caused by template.