Fix few issues caught by valgrind