Change visibility of the initializeDeep methods so we can use it in subclasses. Also guard against null pointers when initializing.