Fix class hierarchy