fixed bugs in python wrapper

fixed bugs in python wrapper :