Another round of profiler fixes/improvements. PR #2882 (Manually Merged)