Fixing up the upgrade and downgrade commands