Fixed a few cperf issues.