Bug fixes on unicode and str (Python 2)