Various minor fixes to MDI.