python2 + 3, some fixes