Allow mime type filtering and fixed a bug with headers.