minor formatting/debugging improvements, a small fix in calculating some metrics