Improve upgrade behaviour