More graceful handling of parents
Fixed duplicate parent IDs being added on mid-tree elements