Adding check for invalid country code.

fixes rSmart/issues#315