Small changes for compatibility with the Python API.