Profiler: fix the alogrithms.