Metrics are calculated incrementally.
Minor fixes.