Various performance improvements.