Phase changes of the disordered In−Mg and Al−Mg alloys