Small performance optimizations

These should be pretty safe.