Bugfixes of upgrading feature