bug fixes to the python library