Fixes profiling when no matches are found
Merge pull request #2593 from systay/profiling-fix

Fixes profiling when no matches are found