Fix upgrades check logic.