Prevent double deletion of the main window.
Optimise and fix SpdrImport operation.