Fixes for compile warnings under g++ (had previously only used clang++)