fixed some template and path related issues.