Remove unused imports.
Handle failure during scanning and skipped files.
Fix sequence of imports.