Made script error out if it fails to recognize digits rather than upgrading again.