fix issues to  work in Python 3.3.2