Use iterateUntil rather than whileM_

Signed-off-by: Ray Lehtiniemi <rayl@mail.com>