fixed Python 3 related issues