Slightly better file type handling