Fixed some template bugs, addedsearch (still needs fixing)