Fix some template errors