Minor performance and readability tweaks.