Added filetype switching.