issue #5837: Fix metric checking problem. Improve cosmetics.

...eversed. Also touch up cosmetics.