fixed removal of duplicate attributes when fixing orphans