Make format detection based on file extension more complete.