Search functionality, many fixes