Fix some warnings found by the clang static analyzer