Fix failures with gcc 4.2
Fix warnings spotted by clang 3.5
Appease yet more gcc 4.2