HPCC-8992 - Various problems in key sampling used by merge

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>