Reduced from the case which triggered the revert of 498aa534, and then generalized to cover both expansion paths.