Optimize the string normalization a bit.