Fixed some template dialog layout related issues.