locale handling fixes