Several performance improvements.