Make ProfilerHandler version-independent.
Fix warnings.