Fix some small bugs found when using clang.