Merge "Fix bugs in profiler"