Micro-optimizations
Merge pull request #3242 from GrahamCampbell/minor-fixes

Micro Optimizations