Fix an ASSERT failure with profiling