Python version compat fixes