Changed the detection method for a bad locale