Fixed upgrading issues.