Fix logic for command steps when upgrade required.