Fixed issues with getCountryByPattern