Adapts merge to properly take into account M/D.