Use a result flag to signal exit status.
Handle retries of scans.