Fix locale checking