Fix subclassing bug