Fix wrong version checking in upgrade.php