fix some compiler warnings (clang and gcc)