fixes to the python API