improve search_link* functions + fix bugs