fix some template issues