Fix several definite bugs that were caught by newer Clang.