Fixes to metrics

Fixed how the metrics were calculated to help improve accuracy.