This patch fixes an issue where if an application was shut down during the import process, importing could have caused a crash next time it was attempted. In addition, a crash might have occured when an import was finished under specific circumstances - this has also been fixed.
Changes are non-breaking. Replace old files with these new files to update.