fixed some typos and syntax errors in upgrade.php