A few minor optimizations