Fix: handle invalid discriminator value