Better handling of bad locales