Better checks for filetypes