minor bug fixes (partially relating to upgrading)