Add dependency collapsing.