Python 3.3 support

fixes various Python 3.3 issues