Fix bug in case insensitive string comparison