fixes of warnings and errors detected by clang