Small fix for lookup_adj_segment, unit test