Fix serialization of inner classes.