Fix localization code bug introduced in previous commit