Fixes bug in profiler