fix rebuild in presence of externally-added children