serialize country codes correctly (fixes #34)