Fix incorrect data types and wrong file name when the file has no extension