Fix bug with changing locale (#248)