Small fixes from valgrind, scan-build, etc