Fix counter error for debugging trace.