SourceContext fixes and profiler optimizations