Renamed numParents to expectedIds. Fixed counting of expectedIds for structures which have single resources