Another grab bag of compiler optimizations

Review by @gkossakowski