Fix uninitialized memory related bug.