Fix generated code for parent classes.