Handle stacking and upgrade/downgrade.