Fix warnings from GCC and clang