Mixed bag of small optimizations.