Added random sampling option in ID; fixed various IFMM issues.