Fixed bug in the calculation of the dndx and dmde grid metrics in get_metrics().