fixes for python wrapper