fixing bugs in MediaType generation and filter