Various optimizations.