fixed most errors on python 3.3