HPCC-10414 Clean up various issues with new stats code

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>