Two small performance improvements