Fix max_iter bug.