Fixed bug whereby new child was flagged as an orphan when its old parent
as deleted.