Fix cast warning in the instrumentation code.