More port fixes for the Python version.