bugs detected by clang checker