Several more minor optimizations