Fixed locale check bug