Fix the string comparisons which can be affected by the users ignorecase
setting. This includes changes to comparisons which are insensitive to the
ignorecase setting but it's important to be consistent to avoid ambiguity.