Fix inheritance order