More fix to correctly detect the file name extension