Switch OPTIM.m to MI. And minor adjustments