Fix filetype detection