Fix class hierarchies