Tiny improvement to string checking.