Fix uninitialized value bug found by valgrind.