Misc. optimizations.