Changed some code in `sim_mixture` and fixed some bugs.