compiler. Cleaned up base/discriminator validation, fixed #337.