Some changes to upgradelib