Bugfixes relating to the way data is handled when calculating metrics.