Fixed minor bugs in searchcontroller