Fix plan-deploy and plan-upgrade