Some minor optimizations.