fix some template errors