Fixed bug in #_check_file_type*