Small tweaks and optimizations.