Fix bug in filetype identification