Python3.3 compat

Fixes a couple of issue with python3.3