Fix some profiling hotspots.