Fix spelling mistake
Restore package list from backup on error

If the script fails to fully execute, restore the backed up
package list so the user is not left without a list at all.