fixed lots of warnings on clang