Add automatic parent detection.