Fix an assertion failure in MDR.

@rev byao@
Merging origin/goliver/master-pending-mdri-assert-fix into master