Improved upgrade behaviour.