Fixed some actual errors found by compiling with clang.