Fix bugs related to localization. Issue #5