Fix error when media type has invalid parameter

fixes #29