Improved error handling for cases where no country is returned