Return str, not unicode string from name getter.

Applies to Python 2.x.
Also Improved compatibility with 3.x.