Some extra optimizations.