All of these `ToLower` need to be `ToLowerInvariant` to avoid problems if this code runs in strange locales.