Hack for discriminator serialization