python 3.3 compat fixes