some discriminator related fixes