Fix compile error and warning with clang