Fixing file type detection