Fix minor issues with Python API