Micro-optimizations

A couple of micro-optimizations related to string operations.