Fix stack overflow when building perf harness
Fix best-common-type computation for classes