Fix #1665 and also fix displaying various filetypes