Fix for writing locales to incorrect location

should fix #8