Fix memory issues with uninitialized pointers.