Fix up Relation class, etc.