Moved locale setting to top of file