Fixing profiling bug