Fix uninitialized access error found by valgrind.