fail on template problem, fix some template problems