Profiler: fix the algorithms.