Improve file type detection method (during import)
A few small fix