fixed minor bugs in python wrapper