Fixed bug in setLocale