Fix error check issue in new profiler functions

Clang complained about this, while gcc did not.