Minor cleanup in the metric code