Add some minor optimizations.