Changes to fix MD bugs.