1) fix memory leak issue 2) fix python bugs