Delete temporary table if it already exists.
Don't reset the isScanning flag before we're really done.