AAI: fix some clang/cppcheck warnings