If target is a nil pointer, initialize target before trying to assign values