Minor performance tweaks.

A bunch of tiny performance tweaks to reduce GC churn and eliminate
unnecessary processing.