Fix copy plugins 

there is a problem with deep (more then 2 level) and out of order plugin pk's