fix invalid error reporting
fix subclassing with constants