Some changes based on a clang static analyzer run