Add more robust detection of case insensitive string compare