Fix alias handling in has_index