Fixed profiler to work properly with functions that have multiple returns