Some fixes found using clang.