HPCC-9853 Fix various warnings (a couple may have revealed minor bugs)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-9853 Fix clang warning/error on precedence of &&

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #4840 from ghalliday/issue9853

HPCC-9853 Fix various warnings (a couple may have revealed minor bugs)

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>