Some bugs and unicode support for python 2.x