Fix compilation warnings and errors with recent c++ standard (compiled on clang 4.2).