HPCC-9465 Fix various issues picked up in the code review

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