Handle subclassing correctly.