Fix attributes when subclassing