A couple of Python version compat fixes