Better profiling.
Some small perf improvements.