Minor tweaks and optimizations.