Improved equals method for Localized