Bug fix and simplify the item analysis page
Allow upgrade.php to be run from command line