Fix crash during printing of the profiler of optimizer.