Fix bug in imcs_search