Fix a bug on filetype setting.