Bring-in of IME changes from Mark's private branch.